Were the officers on submarines specialists?
Usually not, other than specializing in submarines. They were generalists who rotated through various assignments on the boats. If they remained in submarines for a career, they would probably hold most of the officers’ shipboard positions at some point. However, there were some exceptions. There were Engineering Duty Only (EDO) officers who were sometimes assigned to ships and the boats. There were also, at times, warrant officers (WO) or limited duty officers (LDO) who were specialists, usually formerly enlisted, who were commissioned and part of the wardroom.
It should be noted that officers who are submarine qualified do have a special designation in their personnel records. This does not, however, limit their opportunities for assignments or command on other ships.