Either make something a child of say a Empty(or not) GameObject in the inspector or assign the Transform.parent to another Transform(Say gameObject.transform). You can see examples in the documentation of how to do it in code, in the inspector just drag and drop over the gameobject parent you want to make the dragged gameobject/prefab/whatever the child.
or