Connecting two transformers together in effect shorts the generating transformer against the idle transformers winding. I don't know what the resistance of the transformer is. At a minimum it will load down the 24V and deliver a lower voltage to the pump control. Or it may short the transformer and overheat it or blow a fuse, if there is a fuse on the low voltage side.
If you want to try it first I wouls connect the two transformers together and put a voltmeter on the connection and see what voltage you get. See if you blow a fuse or overheat the operative transformer. At worse you risk the cost of a transformer and not your new drive.