You need to specify where you want this subobject to belong to. Generally, you would use it with FObjectInitializer object inside of a constructor. Something like that:
USkeletalMeshSocket is not a component, and shouldn’t be getting created at runtime in general (unless you’re building some custom mesh builder or something like that). What are you actually trying to do, attach something to a socket or find a socket or what?