Heres the run down:
PGY-1: Post graduate year one. Most specialty residencies start in this year and you advance up through PGY-? (e.g. PGY-3 for IM, PGY-5 for surgery, etc).
PGY-2: Post grad year 2. Second year of residency. For most people, this will be at the same program as PGY-1. However, some specialties, such as Radiology, Anesthesia, some Derm, some ER, some optho, some ENT, you match into a PGY-2 position and have to apply separately for you PGY-1 year. This is where prelims and transitionals come from.
Prelim Medicine: Only PGY-1. Usually for people going on to non surgical specialties in PGY-2. You apply and interview separately to these programs which include mostly medicine rotations with a few electives.
Pelim Surgery: Same as above, but generally filled by people going on to a surgery subspecialty.
Transitional: Also only PGY-1. Also apply separately. Only difference is that they have, in general, a more varied schedule and more electives. You do med months, peds months, surgery months, ER, etc.
There are some people who are either undecided or do not match into a PGY-2 position who do these prelims. I think this is a bad idea because you are usually so busy during this year that applying to other programs can be difficult. Not to mention that for competitive specialties the odds of getting in are lower.
Hope that clears some stuff up.