Two Breaker panels, one transfer switch?
Your guess is correct. You will not be able to use a single transfer switch in one of the panels to isolate your generator for both panels. 

The solution may be to discontinue the use of the water heater specific panel and re-wire the water heater into the main panel. Then the single transfer switch in the main panel would work out nicely.

Keep in mind that there may be reasons why you would not be able to re-wire the water heater or why it was wired to a second panel in the first place:


The main panel may have already been over subscribed for a 200A service and installing a second panel was the overall cheapest solution.
The second panel may have been there to allow separate power usage monitoring for the water heater. This could have been done to share some electrical costs with a roommate that was living with and renting from a previous owner.
The main panel may have already been full of circuit breakers and the second panel was one way to be able to add an electric water heater at one time possibly replacing a natural gas fired heater.
You may not have room in the main panel to add the two pairs of additional dual 240V breakers, one for your water heater and the other for your transfer switch back feed breaker.