How to find out if an entity type is provided by core or a contrib/custom module?
You can make use of module handler to get path to extension info file.

/**
 * Implements hook_entity_type_alter().
 */
function example_entity_type_alter(array &amp;$entity_types) {
  $module_handler = \Drupal::moduleHandler();
  foreach ($entity_types as $entity_type =&gt; $entity_type_info) {
    $provider = $entity_types['block']-&gt;getProvider();
    $module = $module_handler-&gt;getModule($provider);
    $info_file = $module-&gt;getPathname();
    drupal_set_message("$entity_type ---&gt; $provider ($info_file)");
  }
}