How can I create a prefab variant in C# script?

I am trying out Unity’s new prefab workflow. I want to programmatically create prefab variant(s) on an prefab I’ve already created. I am using Unity 2018.3.0b7. How can this be done?

During current run:

  1. Instantiate the prefab off-screen
  2. Make the relevant changes to the new instance
  3. Keep a reference to this instance so as to make new instances from it on-wards

Making it permanent:

  1. Instantiate the prefab off-screen
  2. Make the relevant changes to the new instance
  3. Use UnityEditor.PrefabUtility.CreatePrefab("Assets/Resources/...", gameObjectInstance)