/Engine/Source/Runtime/Engine/Classes/Materials/MaterialOverrideNanite.h
This will return the cached override material pointer, if the override material is set, or nullptr otherwise. In a cooked game this will always return nullptr if the platform can't support nanite.
[UMaterialInterface](API\Runtime\Engine\Materials\UMaterialInterface) * GetOverrideMaterial() const