A classic strategy is a large cap on your MCU VDD, and monitor the power source and trigger if it's drop below a certain threshold. E.g. a hardware comparator that flips, which could trigger an IRQ. Then dump contents to non-volatile ASAP and halt other write operations that could corrupt the state.
Sometimes you can also use the ADC for this, through some hardware monitor configuration, or manually on a certain polling interval.
I don't think the other internal peripherals are of much use. Perhaps make sure that the brownout voltage threshold is also set accordingly, or use an external reset monitor.