How can I display a taxonomy term's ancestral tree on a content page? I am using Drupal 8. I have a hierarchical taxonomy vocabulary like this (simplified):

Animals
-Vertebrates
--Fishes
---Butterflyfishes
----Chevron Butterflyfish

On a taxonomy term's page, I automatically get the ancestral tree as breadcrumbs. For example, on drupal/Butterflyfishes I see this:

Animals >> Vertebrates >> Fishes

If I add Butterflyfishes as a Taxonomy term entity reference on a content page (i.e. not the taxonomy term's page itself), how can I also display such an ancestral tree on that content page?
2 possible solutions: a) programmatically via an own custom module providing a custom formatter or via a custom theme function. Or b) via contrib modules providing a field formatter to view the whole term path instead of only the end point (default).

In your case I assume you ask for the second. The module Hierarchical select used to provide this view widget (field formatter) in D7 and maybe alternative modules like SHS or CSHS in D8 will provide it? If not, you can try to work with the Custom formatter module, which enables you to build own formatters in admin UI without creating own modules for this purpose. It comes with examples showing how it works, and it can be used even if the user has no advanced module development knowledge.