Field entities can be created via FieldConfig::create($values).
For example, in the UserRegistrationTest of core, a 'user_picture' field is added to the user entity like this:
$field_storage = FieldStorageConfig::create([
'field_name' => 'user_picture',
'entity_type' => 'user',
'type' => 'image',
]);
$field_storage->save();
$field = FieldConfig::create([
'field_name' => 'user_picture',
'entity_type' => 'user',
'bundle' => 'user',
]);
$field->save();