How do I store node form data between form steps using ajax?
This code is quite impressive. I did not think it was possible to build a multi-step entity form with a few lines in a form alter hook. To keep it this simple you can try to use the entity object to store the values, because the form object is serialized and cached between the steps and a method to build such an entity from the submitted values is part of the entity form class:

  if ($trigger = $form_state-&gt;getTriggeringElement()) {
    $form_object = $form_state-&gt;getFormObject();
    $new_entity = $form_object-&gt;buildEntity($form, $form_state);
    $form_object-&gt;setEntity($new_entity);