Nothing would happen unless the transfer switch (whatever kind it is) has been physically broken in a very serious way. They are designed such that it is physically impossible for both power sources to be connected simultaneously by having some sort of mechanical interlock. It's not good for the switches to switch under load, but if there is no (real) load, it's perfectly safe to start or shut down the generator while connected to shore power.
Should shore power be connected to the generator, unless they were perfectly in phase the shore power would drive the generator into phase with great force. This can cause things like generator rotors being ripped out and sent flying.