You wouldn't. The field definition (extending FieldItemBase
) is the data definition, without any representation on how that data should be displayed. Fields are are not meant to be dependent upon a single formatter, but rather can have any applicable formatter used for the field. This is a purposeful disambiguation. Formatters provide different ways of displaying the field data. So if you are trying to get formatter info in the field definition, it's backwards. You should only be getting field data from the formatter, not the other way around.
Based on your update, you want instead to create a computed field. You can do this by creating a custom plugin, or using the Computed Field module.