I designed such a system on our first motorhome using two 50-amp transfer switches. The first switched from shore power to auxiliary power. the Aux switched between generator and 2KW inverter. The first one had the normally closed contacts wired to shore power. the second switch had the normally closed wired to the inverter.
When connected to shore power the first relay (contactor) connected power to the coach. When in aux mode the inverter fed power through the second contactor to the first contactor to the coach electrical box. When the generator is started the second contactor armature is energized connecting the generator current to the first switch which then fed power to the coach electrical box.
The same thing can be done with single 30-Amp contactors. I used IOTA transfer contactors. This was done fifteen years ago and my son now full times in the coach and the system has never had a problem. Just use large gauge wire and really tighten the connections.