How to alter $form_state before render a form?
An edit form for what exactly?

getForm() accepts arguments. All additional arguments are passed to the buildForm() method of your form. So you pass whatever you are editing in, and when building the form, you get the current value and set it as #default_value of the form elements.

If you are editing entities, then you should consider using an entity form. I'm maintaining the _entityform_block module, which has the following build() method in it's block, you could do something similar in a controller:

$values = array();
// Specify selected bundle if the entity has bundles.
if (\Drupal::entityTypeManager()-&gt;getDefinition($this-&gt;configuration['entity_type'])-&gt;hasKey('bundle')) {
  $bundle_key = \Drupal::entityTypeManager()-&gt;getDefinition($this-&gt;configuration['entity_type'])-&gt;getKey('bundle');
  $values = array($bundle_key =&gt; $this-&gt;configuration['bundle']);
}

$entity = \Drupal::entityTypeManager()
  -&gt;getStorage($this-&gt;configuration['entity_type'])
  -&gt;create($values);

if ($entity instanceof EntityOwnerInterface) {
  $entity-&gt;setOwnerId(\Drupal::currentUser()-&gt;id());
}

$form = \Drupal::entityTypeManager()
  -&gt;getFormObject($this-&gt;configuration['entity_type'], 'default')
  -&gt;setEntity($entity);
return \Drupal::formBuilder()-&gt;getForm($form);