Best way to save enums with weights_only=True?

With weights_only=True being a recommended standard approach, what is the best way to handle enums used for config? Manually convert them to int, then convert back after loading? I suspect adding enums to the allowed exceptions is not an option since enums can have code associated with them.