Pipeline does not correctly set `.feature_names_in_` attribute on classifier

### Describe the bug

`Pipeline` appears not to set/propagate the `.feature_names_in_` attribute between steps in the Pipeline beyond the first step.

### Steps/Code to Reproduce

```python
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import pandas as pd

X, y = load_iris(return_X_y=True)
x = pd.DataFrame(X, columns=["A", "B", "C", "D"])


pipe1 = Pipeline(
    [
        ("classifier", LogisticRegression(random_state=0, max_iter=300)),
    ]
)

pipe2 = Pipeline(
    [
        ('scaler', StandardScaler()),
        ("classifier", LogisticRegression(random_state=0, max_iter=300)),
    ]
)

model1 = pipe1.fit(x, y)
model2 = pipe2.fit(x, y)

c1 = model1.named_steps["classifier"]
c2 = model2.named_steps["classifier"]

c1.feature_names_in_

c2.feature_names_in_
```

### Expected Results

The `.feature_names_in_` attribute should be set for both `c1` and `c2`, returning: `array(['A', 'B', 'C', 'D'], dtype=object)`

### Actual Results

The `.feature_names_in_` attribute is set for `c1`, corresponding to a single step `Pipeline`, but not for `c2`. 

```
>>> c2.feature_names_in_
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'LogisticRegression' object has no attribute 'feature_names_in_'
```

Note that `model2.named_steps["scaler"].feature_names_in_` is set correctly however. So it looks like `Pipeline` is not propagating the feature names across steps correctly.

### Versions

```shell
>>> import sklearn; sklearn.show_versions()

System:
    python: 3.10.4 (main, Apr 26 2022, 19:43:24) [Clang 13.0.0 (clang-1300.0.29.30)]
executable: /Users/xxx/Projects/ecba-version-2/.venv/bin/python
   machine: macOS-11.6.6-x86_64-i386-64bit

Python dependencies:
      sklearn: 1.1.1
          pip: 22.0.3
   setuptools: 60.6.0
        numpy: 1.22.4
        scipy: 1.8.1
       Cython: None
       pandas: 1.4.2
   matplotlib: 3.5.2
       joblib: 1.1.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
         prefix: libomp
       filepath: /Users/xxx/Projects/ecba-version-2/.venv/lib/python3.10/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
    num_threads: 12

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/xxx/Projects/ecba-version-2/.venv/lib/python3.10/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell
    num_threads: 6

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/xxx/Projects/ecba-version-2/.venv/lib/python3.10/site-packages/scipy/.dylibs/libopenblas.0.dylib
        version: 0.3.17
threading_layer: pthreads
   architecture: Haswell
    num_threads: 6
```
```

COMMENT:
Took me a little time to figure out what was going on with my pipelines since `feature_names_in_` seemed to sometimes work and sometimes not, so I'm posting here in case it helps someone else. Since https://github.com/scikit-learn/enhancement_proposals/pull/68/ has been merged it is now possible to use `pipe['modelname'].feature_names_in_` in a pipeline as long as you have set the transform output to pandas dataframes:

```py
from sklearn import set_config
set_config(transform_output='pandas')
```

If you haven't done that, you will have to use something like `pipe[:-1].get_feature_names_out()` instead.

Short demo:
![image](https://github.com/user-attachments/assets/3b63858f-83d2-4c07-9043-e9c63be27be7)

<details>

<summary>Code</summary>

```py
from sklearn.datasets import load_iris
from sklearn.feature_selection import SelectKBest
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.pipeline import make_pipeline

iris = load_iris(as_frame=True)
X = iris['data']
y = iris['target']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=30)

pipe = make_pipeline(
    SelectKBest(k=3),
    DecisionTreeClassifier()
)
pipe.fit(X_train,y_train)
pipe[:-1].get_feature_names_out()

pipe['decisiontreeclassifier'].feature_names_in_

from sklearn import set_config
set_config(transform_output='pandas')

pipe.fit(X_train,y_train)
pipe['decisiontreeclassifier'].feature_names_in_
```

</details>

Labels: Bug, Needs Triage