I'd recommend you diagnose this by removing stuff from the system - starting with the inverter itself. You should be able to set it so the inverter does not come on automatically, using either the remote panel (assuming you have one) or the buttons on the inverter itself. Also, I'd remove the surge guard from the power chain, if you can.
As mentioned by others, you have TWO transfer switches: one that switches automatically from shore to generator as needed; one that switches a portion of the load automatically from shore/generator to inverter, usually feeding a sub-panel.
Another thing you might be asking, is under what circumstances does the power go off? Are you using heat strips that somehow are powered through the inverter (they shouldn't be)? Most RV inverters are rated for 2000 or 3000 watts - quite a lot, but not enough to power the whole coach. Hence the subpanel, which shouldn't have heaters or A/C connected to it. And if you have a plug-in heater, it shouldn't be plugged in to an inverter-supplied outlet. If nothing else, you do *not* want to be running heaters on battery power!
The more information you supply as to what exactly the symptoms are and when they occur, and exactly what your equipment is, the better your chances of getting useful answers.