`transform_output` set in `config_context` not preserved in the Transformer object?

### Describe the bug

This is related to: https://github.com/scikit-learn/scikit-learn/pull/23734 (btw I love this enhancement!), when `config_context` is used the Transformers created within the context do not register/memoize the transform output. This may be expected, tho I could not find that explicitly in the documentation?

<hr>

Could the solution be to add default init to `_SetOutputMixin` to capture `transform_output` if set?

```py
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        transform_output = get_config()["transform_output"]
        if transform_output != "default":
            self.set_output(transform=transform_output)
```

### Steps/Code to Reproduce

This works as expected:

```py
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler

X, y = load_iris(as_frame=True, return_X_y=True)
with sklearn.config_context(transform_output="pandas"):
    scaler = StandardScaler()
    x = scaler.fit_transform(X_test)
    print(type(x))  # <class 'pandas.core.frame.DataFrame'>
```

But:

```py
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler

X, y = load_iris(as_frame=True, return_X_y=True)
with sklearn.config_context(transform_output="pandas"):
    scaler = StandardScaler()

x = scaler.fit_transform(X_test)
print(type(x))  # <class 'numpy.ndarray'>
```

So when `fit_transform` is not under `config_context(transform_output="pandas")` the output defaults to numpy array (default output). `StandardScaler()` constructor doesn't register the config at the construction time.

This is slightly confusing because:

```py
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler

X, y = load_iris(as_frame=True, return_X_y=True)
scaler = StandardScaler().set_output(transform="pandas")

x = scaler.fit_transform(X_test)
print(type(x))  # <class 'pandas.core.frame.DataFrame'>
```

### Expected Results

As a user I would expect that `config_context(transform_output="pandas")` is memoized/registered during transformer construction. Similar to explicitly calling `set_output` on a transformer.

### Actual Results

See above.

### Versions

```shell
System:
    python: 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:23:14) [GCC 10.4.0]
executable: ...
   machine: Linux-5.10.0-20-cloud-amd64-x86_64-with-glibc2.31

Python dependencies:
      sklearn: 1.2.0
          pip: 22.3.1
   setuptools: 65.6.3
        numpy: 1.23.5
        scipy: 1.9.3
       Cython: None
       pandas: 1.5.2
   matplotlib: 3.6.2
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: ...
        version: None
    num_threads: 16

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: ...
        version: 0.3.21
threading_layer: pthreads
   architecture: SkylakeX
    num_threads: 16

       user_api: openmp
   internal_api: openmp
         prefix: libomp
       filepath: ...
        version: None
    num_threads: 16
```

COMMENT:
The behaviour is the one expected when using context manager:

```python
In [5]: with open("xxx.file", "r") as f:
   ...:     f.read()
   ...: print(f.closed)
True
```

Here, the context manager is in charge of closing the file. Basically, you cannot expect it to do whatever on `f` once you are out of the context manager. In this context, if you want to do something then you would store the handle with `f = open(...)` and manage yourself the state of `f`.

In the problem above, you would use `set_output` on the instance or `set_config` to set globally to get the expected results.

So I will close #25288 but I am happy to see an improved documentation.

Labels: Documentation