Issue with check_transformer_general

### Describe the bug

`check_transformer_general` does not work well when sklearn is configured with set_output as pandas. 

To reproduce it, using sklearn version at least 1.2.0: 

```python
from sklearn.utils.estimator_checks import check_transformer_general 
from sklearn.preprocessing import OneHotEncoder
from sklearn import set_config
set_config(transform_output="pandas")
check_transformer_general("OneHotEncoder", OneHotEncoder(sparse_output=False))
```

The cause of the error is the following: 

In `check_transformer_general`, there is this code: 
```python
def check_transformer_general(name, transformer, readonly_memmap=False):
    X, y = make_blobs(
        n_samples=30,
        centers=[[0, 0, 0], [1, 1, 1]],
        random_state=0,
        n_features=2,
        cluster_std=0.1,
    )
    X = StandardScaler().fit_transform(X)
    ...
    _check_transformer(name, transformer, X, y)
```

And in `_check_transformer` this code is executed at the end of the method: 
```python
    transformer.transform(X[:, :-1])
```

The code is valid only if X is a numpy array. 

I think several solutions are valid, maybe the most simple will be checking if the type of X is a dataframe and, if so, converting it to numpy. 

---

In case you are wondering why this is an issue, it's because for a third party library we are considering using pandas dataframe as inputs and outputs always, and hence forcing the setting `set_config(transform_output="pandas")` in the __init__.py. The problem we are facing with this approach is that the tests of our estimators are raising this exception. 

### Steps/Code to Reproduce

```python
from sklearn.utils.estimator_checks import check_transformer_general 
from sklearn.preprocessing import OneHotEncoder
from sklearn import set_config
set_config(transform_output="pandas")
check_transformer_general("OneHotEncoder", OneHotEncoder(sparse_output=False))
```

### Expected Results

No error is thrown. 

### Actual Results

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[/usr/local/lib/python3.8/dist-packages/sklearn/utils/estimator_checks.py](https://localhost:8080/#) in _check_transformer(name, transformer_orig, X, y)
   1642             ):
-> 1643                 transformer.transform(X[:, :-1])
   1644 

8 frames
TypeError: '(slice(None, None, None), slice(None, -1, None))' is an invalid key

The above exception was the direct cause of the following exception:

AssertionError                            Traceback (most recent call last)
[/usr/local/lib/python3.8/dist-packages/sklearn/utils/_testing.py](https://localhost:8080/#) in __exit__(self, exc_type, exc_value, _)
    920         ):
    921             if self.err_msg is not None:
--> 922                 raise AssertionError(self.err_msg) from exc_value
    923             else:
    924                 return False  # will re-raise the original exception

AssertionError: The transformer OneHotEncoder does not raise an error when the number of features in transform is different from the number of features in fit.

### Versions

```shell
System:
    python: 3.8.10 (default, Nov 14 2022, 12:59:47)  [GCC 9.4.0]
executable: /usr/bin/python3
   machine: Linux-5.10.147+-x86_64-with-glibc2.29

Python dependencies:
      sklearn: 1.2.1
          pip: 22.0.4
   setuptools: 57.4.0
        numpy: 1.22.4
        scipy: 1.7.3
       Cython: 0.29.33
       pandas: 1.3.5
   matplotlib: 3.5.3
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.8/dist-packages/numpy.libs/libopenblas64_p-r0-2f7c42d4.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell
    num_threads: 2

       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: /usr/local/lib/python3.8/dist-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
    num_threads: 2

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.8/dist-packages/scipy.libs/libopenblasp-r0-8b9e111f.3.17.so
        version: 0.3.17
threading_layer: pthreads
   architecture: Haswell
    num_threads: 2
```

COMMENT:
I am closing it as I don't think it's an important issue.

Labels: Bug, Needs Triage