If you have a Class5 motor, you can create an interrupt that will call a subroutine to store the values into EEPROM. Status word 6 bit 13 is the Low Bus Voltage bit and may work if your supply doesn't drop out to quickly. You may need a capacitor to make it decay a bit slower so your subroutine has time to execute.