3GPP 24.501 v20.0.0 — the document's own text
4.4.2.1.3 UE entering state 5GMM-DEREGISTERED
If the UE is capable of registration over a single access only, the UE shall store the current native 5G NAS security context on the USIM or in the non-volatile memory and mark it as valid only when the UE enters state 5GMM-DEREGISTERED from any other state except 5GMM-NULL or when the UE aborts the initial registration procedure without having left 5GMM-DEREGISTERED.
If the UE is capable of registration over both 3GPP access and non-3GPP access and is registered on the same PLMN over both 3GPP access and the non-3GPP access, the UE shall store the current native 5G NAS security contexts of the 3GPP access and the non-3GPP access as specified in annex C and mark them as valid only when the UE enters state 5GMM-DEREGISTERED from any other state except 5GMM-NULL over both the 3GPP access and non-3GPP access or only when the UE aborts the initial registration procedure without having left 5GMM-DEREGISTERED over both the 3GPP access and non-3GPP access.