Where do I connect the ground wire of a transfer switch being connected to a sub-panel?
To the ground bar

Grounds go to the ground bar. 

Neutrals go to the neutral bar.  

Grounds never go to the neutral bar, ever.  Not rocket science here.  The only reason anyone has ever had any confusion about that is that in main panels, grounds and neutrals are connnected with an equipotential bond, and because of that, Code allows a shortcut of putting all neutrals and grounds on the same bar, effectively making the whole bar the equipotential bond.   Irrelevant here, obviously.  

In a facility wired entirely in metal conduit, there may be no ground wires anywhere to be seen, and thus, no ground bar.  This is normal. In that case you can obtain an accessory ground bar for that panel and attach to that, or attach via a threaded machine screw to the cabinet (never a sheetmetal screw!) provided the screw's thread is -32 or finer.  You are likely to find 8-32 or 10-32 threaded holes all over the panel.