In MA this actually does work at first glance: a 23% efficient Generac 7171 is rated for 9kW at full output on natural gas, and uses 127 ft3/hr (1.37 therms). This is $0.30/kWh at $2/therm, compared to the $0.323/kWh I pay the power company. If you were doing this for real you'd put in the work to find something more efficient than this unit, which would then be enough to make up for the cost of the generator and the maintenance.
Except it's not legal to do this, and even if it were there'd be a lot of hassle.
I had found some things saying you were limited in how many hours per year you could run standby generators outside of emergencies [1] but possibly this only applies to larger systems? [2]
Except it's not legal to do this, and even if it were there'd be a lot of hassle.