During the Drupal 8 release cycle hook_entity_view_mode_info was introduced and then removed. View modes are now configuration entities, aka yml files stored in config system.

Drupal 7

To create view modes in Drupal 7, you had to implement hook_entity_info_alter() and add to the view modes key for a given entity type. Contrib modules such as display suite and entity view modes did the same thing, with a UI for managing the process.