What is the form id used in user profile edit form?
To override the user form (when editing user profile) you can use hook_form_alter with user_form id.  

On the following example code the current_pass is required so anyone making changes will need to enter it.  Also we assume that any administrator would not be forced to enter the password.

function MODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) { 
  $user = \Drupal::currentUser()-&gt;getRoles();
  //admin's probably should not be forced to enter password 
  if(!in_array("administrator", $user) &amp;&amp; $form_id == 'user_form') {
    //$form['account']['pass']['#required'] = TRUE;    
    $form['account']['current_pass']['#required'] = TRUE;    
  }
}


The user register form can be overriden with either one

function MODULENAME_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) { 
   //
}

function MODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) { 
  if($form_id == "user_register_form"){
    //
  }
}


The module has to be enabled and/or the cache should be rebuild for the system to see those functions