Metadata not routed to transformers in pipeline during cross validation.

### Describe the bug

When using a pipeline with transformers in combination with cross validation, it seems that metadata is not correctly routed to the transformers during prediction. I would expect, that if `set_transform_request` is set, that this is honored when calling predict on the pipeline.

**Edit:** At least according to the code this is a known limitation. Although I couldn't find an issue tracking the progress on this.
https://github.com/scikit-learn/scikit-learn/blob/9028b518e7a906a806a1dc8994f2714cc980c941/sklearn/model_selection/_validation.py#L362C1-L367C14

### Steps/Code to Reproduce

```python
import sklearn
from sklearn.pipeline import Pipeline
from sklearn.linear_model import LinearRegression
from sklearn.datasets import make_regression
from sklearn.base import TransformerMixin, _MetadataRequester
from sklearn.model_selection import cross_validate

print(sklearn.__version__)

sklearn.set_config(enable_metadata_routing=True)


class DummyTransfomerWithMetadata(TransformerMixin, _MetadataRequester):

    def fit(self, X, y=None, metadata=None):
        return self

    def transform(self, X, y=None, metadata=None):
        print(f"Received {metadata=}")
        return X

    # We need to explicitly implement fit_transform,
    # otherwise transform will not receive metadata during fit
    def fit_transform(self, X, y=None, metadata=None):
        return self.transform(X, y, metadata)


X, y = make_regression()

transformer = DummyTransfomerWithMetadata()
transformer.set_fit_request(metadata=True)
transformer.set_transform_request(metadata=True)


pipe = Pipeline([
    ("transformer", transformer),
    ("clf", LinearRegression())
])


print(f"--- Cross validation ---")
cross_validate(
    pipe, X, y, params={"metadata": "Some metadata"}, cv=2
)
```

### Expected Results

```
1.7.0
--- Cross validation ---
Received metadata='Some metadata'   # Fit 
Received metadata='Some metadata'   # Predict
Received metadata='Some metadata'
Received metadata='Some metadata'
```

### Actual Results

```
1.7.0
--- Cross validation ---
Received metadata='Some metadata'
Received metadata=None
Received metadata='Some metadata'
Received metadata=None
```

### Versions

```shell
System:
    python: 3.12.9 (main, Feb 12 2025, 14:50:50) [Clang 19.1.6 ]
executable: /home/max/.cache/uv/archive-v0/unVsgMut5oyZJu14JLk-G/bin/python
   machine: Linux-6.1.138-1-MANJARO-x86_64-with-glibc2.41

Python dependencies:
      sklearn: 1.7.0
          pip: None
   setuptools: None
        numpy: 2.3.1
        scipy: 1.16.0
       Cython: None
       pandas: None
   matplotlib: None
       joblib: 1.5.1
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 12
         prefix: libscipy_openblas
       filepath: /home/max/.cache/uv/archive-v0/unVsgMut5oyZJu14JLk-G/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-56d6093b.so
        version: 0.3.29
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 12
         prefix: libscipy_openblas
       filepath: /home/max/.cache/uv/archive-v0/unVsgMut5oyZJu14JLk-G/lib/python3.12/site-packages/scipy.libs/libscipy_openblas-68440149.so
        version: 0.3.28
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 12
         prefix: libgomp
       filepath: /home/max/.cache/uv/archive-v0/unVsgMut5oyZJu14JLk-G/lib/python3.12/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
```

COMMENT:
I confirm that we have an issue here.

@StefanieSenger I look at it a little bit. I think it is quite related to https://github.com/scikit-learn/scikit-learn/issues/27977

Right now, we use a Scorer, to compute the score. The `Scorer` will call `predict` on the pipeline which will call `transform` for the intermediate steps.

While we pass the `score_params` for the scorer, we don't pass metadata related to how to get the prediction. My understanding is that the following line should take into account the metadata:

https://github.com/scikit-learn/scikit-learn/blob/ba954b785e592d53193385c7f1d6d9e53806b4db/sklearn/metrics/_scorer.py#L400-L405

and thus `_get_response_values` should be adapted.

Labels: Bug, Metadata Routing