Gotta remember, simply unplugging the machine from the grid would protect in in all but the absolute worst of situations, emp and solar storms rely on conductors collecting and delivering a fatal charge to the device, theres no magic, its just a high enough voltage to harm them. Trying to emp bomb a off and disconnected pc is magnitudes harder and requires massively more energy density in the field than one thats connected. Even one thats connected is pretty tuff, varistor's and a bunch of other parts in the power supply can short out and protect the typical pc from several-times normal line voltage events.
Power distribution and long phone lines are both great charge collectors, firstly there not shielded and secondly there really long and often suspended for vast distances in mid air. thats great for collecting a emp or solar storm charge. Yep it can indeed be enough to damage transformers just like any electronic device, there only insulated to a certain level, break the insulation down with high voltage and the magic smoke escapes.
Hence in all honesty in the event of a sever solar storm, best just turn all the breakers off and the same with machine disconnects. Insulate the machine as much as possible from the charge, whilst still keeping it grounded gives it the best chance of survival, juat like in a lightening event. But for your typical cnc in a typical industrial building with metal cladding and metal roof on a steel frame bonded to earth its going to do a pretty good job of being a Faraday cage to high power events short of a dedicated emp attack which often reallies on microwave radiation as its able to penetrate smaller holes than longer wave lengths to penetrate devices and cause harm.