Find the class responsible for a particular field type

$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
$class = $field_type_manager->getDefinition('entity_reference')['class'];

this will show you info 

Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem

so you can check there settings and code for this field type.