Electrician connected new water well to house panel, but confused about wire size in generator transfer switch?
If the 12AWG submersible pump wire is fine, then the 10AWG in the transfer switch is certainly fine too

A circuit's ampacity is set by the thinnest wire in the circuit.  As a result, since we know that there's 12AWG wire in the circuit (going downhole to the pump), the 10AWG wire between the house panel and the transfer switch is fine.