Recommendation for mounting transfer switch to vinyl sided exterior wall
The first option that comes to mind is U-strut. (Channel strut or C-channel)

Photo from fireequip.com.au
The first two struts would be mounted vertically  on studs with at least  three points. Use   double ended lag screws, (wood threads on one side and machine threads on the other)

Pilot drill through the siding/foam board and into a stud. Drive the appropriate length lag in so that a nut on it will be proud of the siding. Then on each lag goes a nut, big flat washer, U-strut, washer nut. Now you have two solid vertical rails to work with.
You can mount horizontal U-strut to these or a board, You have many options.
A YouTube search will give many sources of info on U-strut.