What do you have? More info would be helpful. I have a Matrix 5000, sinewave 3750watts as I recall.
Anyway I think you will have to wire up a battery bank to be 48V to run it. That's allot of amps comming out of the batteries if you start putting heavy loads on it like any where near 3-5kw! I don't think there's going to be any easy or cheap way to boost volts from 24v to 48v that would handle that many amps for running it.
Probably many ways to boost the volts from the genny without making a new stator though. If you have an AC output you can get to maybe boost the volts with a transformer then rectifie to DC, make sure the transformer can handle the max or more that the genny can put out. You might be able to just tap into the batteries and charge them as 2 sets of 24v each leaving the genny as is.
Probably more info is needed for a better answer. Like what is the 5KW UPS, are you wanting to use it full time, use it part time and keep an existing 24V system for full time, type of genny, etc...
My Matrix 5000 has a large no load draw of about 136watts from the 48V bank when turned on and no loads being powered. If your planning fulltime use of yours you may want to check that also.