Can I use a generator?

Yes, but generators must be operated safely and according to manufacturer instructions.