How can I determine if a $form (or $form_state) is an entity create/edit form
You can check if the form is an instance of EntityForm and then get the entity to check the entity type:

if ($form_state-&gt;getFormObject() instanceof \Drupal\Core\Entity\EntityFormInterface) {
  $entity_type = $form_state-&gt;getFormObject()-&gt;getEntity()-&gt;getEntityTypeId();
}