KBinsDiscretizer calling get_feature_names_out only works for encode = "onehot"

### Describe the bug

When using `KBinsDiscretizer` with encode set to anything but "onehot", calling `get_feature_names_out` on a fitted instance raises an AttributeError as shown below. It looks like as if the `self._encode` attribute is only available when `encode="onehot"`. The example below might look a bit useless, but when integrating  `KBinsDiscretizer` on a `ColumnTransformer`, I usually call `get_feature_names_out` on that instance to see what type of features it produces. This of course does break if any of the transformers used doesn't properly implement the `get_feature_names_out` API.

### Steps/Code to Reproduce

```python
import pandas as pd
from sklearn.preprocessing import KBinsDiscretizer

data = pd.DataFrame({"a":list(range(100))})
kbd = KBinsDiscretizer(n_bins=10, encode='ordinal', strategy='quantile').fit(data)
names = kbd.get_feature_names_out()
```

### Expected Results

The names of the output feature, which is probably the same as the input feature.

### Actual Results

```pytb
Traceback (most recent call last):
  File
line 3251, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-19-fbbefdd5a8b5>", line 1, in <module>
    kbd.get_feature_names_out()
  File "/.venv/lib/python3.9/site-packages/sklearn/preprocessing/_discretization.py", line 396, in get_feature_names_out
    return self._encoder.get_feature_names_out(input_features)
AttributeError: 'KBinsDiscretizer' object has no attribute '_encoder'
```

### Versions

```shell
System:
    python: 3.9.7 (default, Nov 10 2021, 10:51:48)  [Clang 11.1.0 ]
   machine: macOS-10.16-x86_64-i386-64bit
Python dependencies:
          pip: 22.0.3
   setuptools: 58.3.0
      sklearn: 1.0.2
        numpy: 1.22.2
        scipy: 1.8.0
       Cython: None
       pandas: 1.4.1
   matplotlib: 3.5.1
       joblib: 1.1.0
threadpoolctl: 3.1.0
Built with OpenMP: True
```

COMMENT:
What about something like TargetEncoding?

```
target_encoding_features = ["CarName"]
one_hot_features = [
    "fueltype",
    "aspiration",
    "doornumber",
    "carbody",
    "drivewheel",
    "enginelocation",
    "fuelsystem",
]


features_df = car_price_df.drop(columns=["price", "car_ID"])
print(features_df)
target_df = car_price_df["price"]

column_transformer = make_column_transformer(
                (ce.TargetEncoder(handle_unknown="value"), target_encoding_features),
                (OneHotEncoder(), one_hot_features), remainder='passthrough')

preprocess = column_transformer.fit_transform(features_df, target_df)
column_transformer.get_feature_names_out()
```

I'm getting the positional arguments error:
```
TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_74336\2901201130.py in <module>
     33 
     34 preprocess = column_transformer.fit_transform(features_df, target_df)
---> 35 column_transformer.get_feature_names_out()
     36 
     37 

~\anaconda3_2022_10\lib\site-packages\sklearn\compose\_column_transformer.py in get_feature_names_out(self, input_features)
    479         transformer_with_feature_names_out = []
    480         for name, trans, column, _ in self._iter(fitted=True):
--> 481             feature_names_out = self._get_feature_name_out_for_transformer(
    482                 name, trans, column, input_features
    483             )

~\anaconda3_2022_10\lib\site-packages\sklearn\compose\_column_transformer.py in _get_feature_name_out_for_transformer(self, name, trans, column, feature_names_in)
    452         ):
    453             column = _safe_indexing(feature_names_in, column)
--> 454         return trans.get_feature_names_out(column)
    455 
    456     def get_feature_names_out(self, input_features=None):

TypeError: get_feature_names_out() takes 1 positional argument but 2 were given
```


which I think is coming from the ```target_df``` being an additional parameter to ```fit_transform```

Labels: Bug