In Vanilla, forcing specialists is as simple as clicking the plus button next to the icon while the city is still set to automate. Clicking plus and minus will change the number of forced specialists. So if you want two citizens to always be working as priests, you click 'plus' twice next to the priest icon. Clicking minus once reduces it to 1 forced priest, again will give put all citizens back to automate, but clicking minus when there are none forced turns off automation, just like clicking a workable plot would.
I can't remember how they're displayed... either a yellow box appears around those specialists that are forced, or you could roll over the icon, and the number is described in parenthetical text: "3 (2 forced)" would mean there are three citizens working as priests, two of which were assigned by you, one of which was assigned by the governor. Since C2C has changed the display, the yellow boxes won't work.
As implied, the governor can still assign other specialists, or assign more than the number you've forced (unlike in Civ5's lousy system).
(When playing with a specialist economy, forcing a single specialist often guided the governor in specializing the city. If a completely automated city was equally split between scientists and merchants, or had only merchants because the governor decided that's what your empire needs, you could force one scientist and often the governor would follow suit by assigning all extra citizens to scientists.)
Anything I missed? Sorry I don't know anything at all about the code behind it.