Given $node, this is how you get the edit form ($node_form).

$form = \Drupal::entityTypeManager()->getFormObject('node', 'default')->setEntity($node);
$node_form = \Drupal::formBuilder()->getForm($form);