Maybe even have three rotations:
1st rotation: ensign - Lt
2nd rotation: Lt Com-Com
3rd rotation: Capt-Commadore
Each rank may take a couple of years. You can stay someplace if you like it but your promotions with stop once you max out for that rotation. So if you really like Starfleet Medical within your first rotation then you would max out at LT and stay there. This could be fine for a lot of people who don't want the greater responsibility. Within Starfleet Medical you could do a lot of different things but you couldn't get a promotion.
NCOs may do it differently. Maybe only one rotation for top end NCOs. Otherwise they stay with one branch. They get more specific knowledge of an area but the officers get more general experience.