Scriptable Object Field Serialization

Is there a way that can serialize a scriptable object field as a serialized property instead of a guid? I found out the TimelineAsset and TrackAsset are both subclass of PlayableAsset which is bascially a ScriptableObject. I wonder how unity serialize TrackAsset field inside the Timeline serialization file without creating a TrackAsset itself and referencing it by guid. Is there anything special in ISerializeCallback functions? Can I do the same thing with the C# script?

They probably use something like ExpandableAttribute and create the asset in the background.

OK, I think I got it. The TrackAsset and the TimelineAsset are serialized in the exact same file. AssetDatabase.LoadAllAssetsAtPath() gives me the timeline, the tracks and all the animation playable assets. Thus, my assumption is that AssetDatabase.AddObjectToPath can do the job, which can be an alternative to serialize an abstract class.