Generators can create surges which can damage chargers, power supplies and systems. I would strongly recommend getting a good surge suppressor for your system and its peripherals. Did you look at getting a UPS? Or an anti-vampire outlet strip? [https://paylesspower.com/blog/vampire-energy/|COMPLETE GUIDE TO VAMPIRE POWER]
You selected a MagSafe charger what system are you using? Did you check the systems battery? Install this gem of an app [https://www.coconut-flavour.com/coconutbattery/|CoconutBattery]. Take a snapshot of the apps main window and post it here for us to see [guide|21499]