How do I alter the login form?
Try clearing cache and then visiting login page again, that should show Form ID. It will be hidden again when you refresh login page.

use \Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_alter().
 */
function [MODULE_NAME]_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  echo $form_id;
  switch ($form_id) {
    case 'user_login_form':
      // Do your code here to alter login form.
      break;
  }
}