If you don’t want to manually store the state_dicts, then I would recommend to check out some higher-level APIs such as Ignite and Lightning, which both have their checkpointing utility functions.
CC @vfdev-5 and @williamFalcon for more information.