Saves model checkpoints at specified intervals.
@spec every(pos_integer(), Path.t()) :: (map() -> map())