Yes, through the use of a properly sized 120V generator and a transformer, you can create 240V to run a well pump, provided the controls for the pump are not 120V, but it is also important to remember that the transformer would also need circuit protection between the well pump and the transformer, protecting the secondary side of the circuit. There would be no neutral on the secondary (240V) side of the transformer, so you could run the pump motor, but couldn't power any 120V loads on the secondary side of the circuit.
As others have mentioned, its also important to remember that you can't take 2x 120V generators to run a 240V load because the generators will not be perfectly out of phase of one another to provide clean, synched 240V power to the load. A transformer and paralleled generators would work in theory in this application, but only if the generators have the ability to sync their phasing through the inverters to provide a clean 120V voltage to the transformer to be able to provide a clean 240V output from the transformer.
If the inverter generators have the ability to output a synchronous 120V while in parallel through the use of the primary generator's inverter, this would work and would be safe providing there is OCP on the secondary side of the transformer circuit.
With all that said, in most applications where people need 120/240V backup or off-grid supply, a properly sized 120/240V generator is the best bet. If it is being used to provide backup power, it is also important to remember that the circuit needs to have a transfer switch or breaker-interlock transfer circuit, properly sized to load the generator would be providing and the demand of the circuits it would be providing.
When sizing transformers, remember that transformers do have losses and that it is important to size the transformer over the size of the demand of the well pump, effluent pump, etc. to account for in-rush current and voltage drop over the length of the circuit.
I ran into an issue where a customer had a 240V effluent pump fed off of a 208V service and a buck-boost transformer was used to provide the 240V to the pump motor. Because of the in-rush current of the pump starting exceeded the rating of the buck-boost transformer, the voltage would drop significantly enough during pump startup, causing the amperage to spike enough that the start capacitors for the pump would experience an amperage exceeding their rating, which led to repeated failure of the capacitors. It ended up being one of those instances where the correct equipment (a 208V 3ph pump motor) for the application would have been a much better solution than using additional equipment (in this case, a buck-boost transformer) to make the spec'ed / installed equipment work.
I think your best bet, in this case, would be to get a properly sized 120/240V generator to run the circuits you need, rather than using paralleled smaller 120V generators and a transformer to run a 240V load, especially in the case of a well pump, as if the pump motor gets damaged, its not just the cost of a new pump that you have to take into consideration, but also the cost of having a well tech come out or the labor involved to pull the well head, disconnect the water, pull the well pump up, replace the pump, set it back in, reassemble, not to mention the downtime of not having water during that time.
Just my two cents.