How do I assign a template to the user edit form?
To add an additional template level to a form, add the #theme key to the form array:

$form['#theme'] = ['bs_user_form'];


and in my_module.module:

/**
 * Implements hook_theme().
 */
function my_module_theme($existing, $type, $theme, $path) {
  return [
    'bs_user_form' =&gt; [
      'render element' =&gt; 'form',
      ],
  ];
}


The template name is then bs-user-form.html.twig, where you can print the form with {{ form }} or theme it like for example:

entity-moderation-form.html.twig

&lt;ul class="entity-moderation-form"&gt;
  &lt;li&gt;{{ form.current }}&lt;/li&gt;
  &lt;li&gt;{{ form.new_state }}&lt;/li&gt;
  &lt;li&gt;{{ form.revision_log }}&lt;/li&gt;
  &lt;li&gt;{{ form.submit }}&lt;/li&gt;
&lt;/ul&gt;
{{ form|without('current', 'new_state', 'revision_log', 'submit') }}




You can add theme suggestion to the theme name, but don't use form__ as base hook, because this is already used for the Form element, which caused the error.