Hey there,
Lyra provides a completely working example of player remappable keys with Enhanced Input. Check out the “AddOrUpdateCustomKeyboardBindings” function in LyraSettingsLocal.cpp as well as ULyraInputComponent::AddInputMappings in LyraInputComponent.cpp.
As of UE 5.0, Enhanced Input has out of the box support for player mappable keys with the “Player Mappable Options” in an input mapping context.
This exposes some metadata options for each key mapping as well as an FName that you can give that key mapping to save it to your settings.
I hope that helps,
Ben