Welcome to the forum.
It kind of sounds like the transfer switch to me but I'm not an expert.
While you are waiting for somebody who is more knowledgeable, here's an old thread about, what the writer says is, a problem on older Fleetwood motorhomes. He's describing just the opposite situation where there's no power on the generator after being plugged to shore power but your problem still could be a stuck transfer switch:
https://www.irv2.com/forums/f107/tra...nt-118232.html