If you can live with the limited backup time, I'd say this sounds like a job for a UPS. As has been pointed out, you don't need a particularly good waveform, so anything big enough and cheap enough should do fine. I have found that it is usually a lot cheaper to buy a bigger UPS with standard batteries than a smaller UPS with extended runtime batteries, particularly second-hand. A cheap off-line type of at least 1000VA should be fine and would give at least 30 min of pump runtime with a 1/2 HP pump. Back-up time on no load would probably be well over 2 hours. A runtime chart for the APC SmartUPS range can be found at
http://www.apc.com/products/runtime_for_extendedruntime.cfm?upsfamily=165It is some time since I ran a UPS from a generator. We had to use a very expensive on-line type (made by Galatrek in the UK, local for us) with the intelligence to ignore the deviation from a perfect mains-frequency waveform. Trying to run anything else meant that the UPS was in near-permanent battery mode as it saw the frequency changes as the generator speed controller did its thing, interpreted them as mains failures and switched into back-up mode. I understand the APC "smartUPS" range (line interactive), among others, has adjustable sensitivity to allow operation on generators. Limited experience suggests that, while a big improvement, it is not a complete solution. The only testing I did was on a cheap gas-powered generator of about 5 kVA. You may find your generator has better speed control and does not cause a problem.
Personally, I would look for a second-hand smartUPS between 1000 and 2200 VA and take it out of circuit anytime I ran the generator.
If you don't feel you could live with the limited backup time, it is probably worthwhile going with the 12V pump and battery bank, someone suggested. With 12V switches and without the burden of running an inverter, either stand-alone or in a UPS, you would have a potential standby time of weeks without needing a huge battery bank.