Error after fitting pipeline: "This OneHotEncoder instance is not fitted yet"

### Describe the bug

I've trained a simple pipeline with a OneHotEncoder and a RandomForestClassifier model. **After fitting the pipeline**, I try to access the encoder's categories but the following error messages appears:
```pytb
NotFittedError: This OneHotEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
```
I'm using scikit-learn version 1.1.1.

### Steps/Code to Reproduce

```python
# please ignore the horrible preprocessing, it's just an MWE
from sklearn.datasets import fetch_openml
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline

np.random.seed(42)

X, y = fetch_openml("titanic", version=1, as_frame=True, return_X_y=True)
X = X[['pclass', "sex", "age", "fare", "embarked"]]
X[['sex', 'embarked']] = X[['sex', 'embarked']].astype(str)
X['age'] = X['age'].fillna(30)
X[['fare', 'pclass']] = X[['fare', 'pclass']].fillna(0)
X[['sex', 'embarked']] = X[['sex', 'embarked']].fillna('empty')

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

preprocessor = ColumnTransformer(
    transformers=[
        ("cat", OneHotEncoder(handle_unknown="ignore", drop="first"), ['embarked', 'sex', 'pclass']),
    ],
  remainder='passthrough'
)

pipeline = Pipeline(steps=[
    ('preprocessor', preprocessor),
    ('clf', RandomForestClassifier())
])
fitted_pipeline = pipeline.fit(X_train, y_train)

# accessing the ColumnTransformer's OneHotEncoderObject
fitted_pipeline.steps[0][1].transformers[0][1].get_feature_names_out(['sex', "embarked"])
```

### Expected Results

I would expect to see the output of get_feature_names_out, something like:
```python
enc.get_feature_names_out(['sex', 'embarked']):
>> array(['sex_male', 'sex_female', 'embarked_s', 'embarked_q', 'embarked_c'])
```
But I'm just getting the error.


### Actual Results

```
NotFittedError                            Traceback (most recent call last)
<command-4177303583894672> in <module>
----> 1 fitted_pipeline.steps[0][1].transformers[0][1].get_feature_names_out(['Sex', "Embarked"])

/local_disk0/.ephemeral_nfs/envs/pythonEnv-2bed8a65-e245-40c7-b358-f97394707193/lib/python3.8/site-packages/sklearn/preprocessing/_encoders.py in get_feature_names_out(self, input_features)
   1100             Transformed feature names.
   1101         """
-> 1102         check_is_fitted(self)
   1103         input_features = _check_feature_names_in(self, input_features)
   1104         cats = [

/local_disk0/.ephemeral_nfs/envs/pythonEnv-2bed8a65-e245-40c7-b358-f97394707193/lib/python3.8/site-packages/sklearn/utils/validation.py in check_is_fitted(estimator, attributes, msg, all_or_any)
   1343 
   1344     if not fitted:
-> 1345         raise NotFittedError(msg % {"name": type(estimator).__name__})
   1346 
   1347 

NotFittedError: This OneHotEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
```

### Versions

```shell
System:
    python: 3.8.10 (default, Mar 15 2022, 12:22:08)  [GCC 9.4.0]
executable: /local_disk0/.ephemeral_nfs/envs/pythonEnv-2bed8a65-e245-40c7-b358-f97394707193/bin/python
   machine: Linux-5.4.0-1080-azure-x86_64-with-glibc2.29

Python dependencies:
      sklearn: 1.1.1
          pip: 21.0.1
   setuptools: 52.0.0
        numpy: 1.22.4
        scipy: 1.6.2
       Cython: 0.29.23
       pandas: 1.2.4
   matplotlib: 3.4.2
       joblib: 1.0.1
threadpoolctl: 2.1.0

Built with OpenMP: True
Exception ignored on calling ctypes callback function: <function _ThreadpoolInfo._find_modules_with_dl_iterate_phdr.<locals>.match_module_callback at 0x7f7e90615550>
Traceback (most recent call last):
  File "/databricks/python/lib/python3.8/site-packages/threadpoolctl.py", line 400, in match_module_callback
    self._make_module_from_path(filepath)
  File "/databricks/python/lib/python3.8/site-packages/threadpoolctl.py", line 515, in _make_module_from_path
    module = module_class(filepath, prefix, user_api, internal_api)
  File "/databricks/python/lib/python3.8/site-packages/threadpoolctl.py", line 606, in __init__
    self.version = self.get_version()
  File "/databricks/python/lib/python3.8/site-packages/threadpoolctl.py", line 646, in get_version
    config = get_config().split()
AttributeError: 'NoneType' object has no attribute 'split'

threadpoolctl info:
       filepath: /local_disk0/.ephemeral_nfs/envs/pythonEnv-2bed8a65-e245-40c7-b358-f97394707193/lib/python3.8/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
         prefix: libgomp
       user_api: openmp
   internal_api: openmp
        version: None
    num_threads: 8

       filepath: /databricks/python3/lib/python3.8/site-packages/scipy.libs/libopenblasp-r0-085ca80a.3.9.so
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.9
    num_threads: 8
threading_layer: pthreads
```

COMMENT:
You need to use the fitted attribute which is `transformers_`. Only pipeline does not expose a `steps_` fitted attribute but this is more a bug that we intend to correct in the future.

Thus, I would say that the most explicit way to right what you want is:

```python
fitted_pipeline[0].named_transformers_["cat"].get_feature_names_out()
```

that gives:

```
array(['embarked_Q', 'embarked_S', 'embarked_nan', 'sex_male',
       'pclass_2.0', 'pclass_3.0'], dtype=object)
```

Labels: Bug, Needs Triage