As long as you do 8 months of IM-related rotations, 6 of which need to be IM words (or medical ICU). Categorical programs are the overwhelming majority. Transferring into categorial program would require a PGY-2 spot become open (either losing a rising intern or expanding positions). This doesn't happen frequent enough to bank on it. The other option is applying to advanced programs. Some of these have an agreement with their in-house IM department, so they'd expect you to do your internship at the same institution. Keep that in mind.
Easiest route is probably to apply to categorical programs and redo intern year.