The one and only transfer switch that I am familiar with used the 120 VAC voltage from the "Generator" via a time delay circuit to power the transfer relay to CLOSE the Normally Open contacts. Since you do not have a generator then this "Generator Ready" circuitry must be receiving sufficient voltage FROM THE SHORE POWER (and in some fashion bypass the delay circuit) to cause the relay to energize THEN, because the shore power has been cut off" immediately disengage only to be repeated.
So, the question becomes. how is this shore power "leaking" to the generator ready wiring? You will need to be the judge of that, any chance there is condensation or moisture inside the transfer switch box? I say this because there is a MOSFET (I think) in the delay circuit that could be sensitive and trigger via condensation and moisture (and thereby bypassing the delay aspect which is based on heating a thermal device). etc etc
(On edit, FET changed to MOSFET and thermal aspect of delay circuit)