Generators are best found in Project Zomboid in backyard tool sheds. You can also try your luck at storage lots.

Tool Shed Locations

Tool Sheds can be found in the backyard of homes. You can spot them by opening your map and looking for the small brown structures next to houses.