I used the following to get the parent of a taxonomy term in drupal 8:
$parent = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadParents($termId);
$parent = reset($parent);
Now that I have the parent how do I get the parent tid from that?