The following snippets show you how to add hooks in order to generate twig files like mymodule/templates/my-entity--full.html.twig etc:
We can make the variables available by using the hook_theme(), template_preprocess_offer(), and offer_theme_suggestions_offer_alter hook in modules/custom/offer/offer.module. You need all three of them in order to work with twig files to customize your view modes with twig inside your module!
Add a templates/offer--full.html.twig, templates/offer--teaser.html.twig and also a templates/offer.html.twig. The last is a fallback file for if you create a new view mode and there is no twig file available for that view mode.
These snippets were part of my video course Drupal 9 module development: introduction to custom entities.