Programmatically display the User Register form

$entity = \Drupal::entityManager()
  ->getStorage('user')
  ->create(array());
$formObject = \Drupal::entityManager()
  ->getFormObject('user', 'register')
  ->setEntity($entity);
$form = \Drupal::formBuilder()->getForm($formObject);
$output = array(
  '#type' => 'markup',
  '#markup' => \Drupal::service('renderer')->renderRoot($form),
  '#attached' => $form['#attached'],
);