There's nothing particularly fancy or hard about this. At the hardware level, the cartridge just needs a battery to keep the RAM chip from losing its contents.
A battery can be added to any cart. If the cart doesn't have a RAM chip,
it can also be added. Some games even use the weird solution of battery-backing the CHR-RAM, and having a few tiles hold game state instead of graphics (each tile is 16 bytes).
If we're talking emulation, the steps to enable saving might differ depending on the header. The older
iNES header doesn't have any fields that specify the size of PRG-RAM or its size, only a bit specifying whether it should be saved or not. Just set that bit. The
newer header format allows you to
specify the size of the PRG-RAM.
Once you have saving enabled, it's just a matter of using the RAM at $6000-$7FFF. If it's battery-backed, its contents will be preserved between power cycles. To avoid data corruption, it's good practice to validate the saved data using checksums or something similar, and to have a few copies of the same data so you can possibly recover in case something does get corrupted (with 3 copies of the same data, you increase the chances of one of them matching the checksum). Holding reset when powering off is necessary because the CPU gets a little crazy when the power goes down, and it might accidentally overwrite bytes at $6000-$7FFF, corrupting your saves. Holding reset keeps the CPU stopped at the first instruction of the program, preventing it from writing anything anywhere.