20-30kW might be a bit higher than needed unless the trailer is oversized to provide extra cargo capacity in addition to carrying the generator. You don't need a generator big enough to prevent the battery from draining at all; you just need to extend the range enough to cover a full day of driving while offsetting the extra drag from the trailer. 10-15kW is probably plenty for a trailer that only carries the generator: that would double the highway range of a Model S and would weigh about 700 lbs while being compact enough to have very little aerodynamic drag. A 30kW generator would be enough to double the range even if the trailer doubled the energy consumed per mile, and that's only going to happen with a pretty large trailer.