PowerTransformer fails with unhelpful stack trace with all-nan feature and method='box-cox'

### Describe the bug

`PowerTransformer("box-cox").fit(x)` throws a difficult-to-debug error if x contains an all-nan column. 

### Steps/Code to Reproduce

```python
import pandas as pd
import numpy as np

from sklearn.preprocessing import PowerTransformer, StandardScaler

x = np.ones((20, 5))
y = np.ones((20, 1))

x[:, 0] = np.nan

PowerTransformer().fit_transform(x)  # preserves all-nan column
PowerTransformer('box-cox').fit_transform(x)  # Throws an error when calling stats.boxcox
```

### Expected Results

Either no error is thrown and the all-nan column is preserved, or a descriptive error is thrown indicating that there is an unfittable column 

### Actual Results

```
ValueError                                Traceback (most recent call last)

[<ipython-input-12-563273596add>](https://localhost:8080/#) in <cell line: 1>()
----> 1 PowerTransformer('box-cox').fit_transform(x)

4 frames

[/usr/local/lib/python3.10/dist-packages/sklearn/utils/_set_output.py](https://localhost:8080/#) in wrapped(self, X, *args, **kwargs)
    138     @wraps(f)
    139     def wrapped(self, X, *args, **kwargs):
--> 140         data_to_wrap = f(self, X, *args, **kwargs)
    141         if isinstance(data_to_wrap, tuple):
    142             # only wrap the first output for cross decomposition

[/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_data.py](https://localhost:8080/#) in fit_transform(self, X, y)
   3101         """
   3102         self._validate_params()
-> 3103         return self._fit(X, y, force_transform=True)
   3104 
   3105     def _fit(self, X, y=None, force_transform=False):

[/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_data.py](https://localhost:8080/#) in _fit(self, X, y, force_transform)
   3114         }[self.method]
   3115         with np.errstate(invalid="ignore"):  # hide NaN warnings
-> 3116             self.lambdas_ = np.array([optim_function(col) for col in X.T])
   3117 
   3118         if self.standardize or force_transform:

[/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_data.py](https://localhost:8080/#) in <listcomp>(.0)
   3114         }[self.method]
   3115         with np.errstate(invalid="ignore"):  # hide NaN warnings
-> 3116             self.lambdas_ = np.array([optim_function(col) for col in X.T])
   3117 
   3118         if self.standardize or force_transform:

[/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_data.py](https://localhost:8080/#) in _box_cox_optimize(self, x)
   3272         # the computation of lambda is influenced by NaNs so we need to
   3273         # get rid of them
-> 3274         _, lmbda = stats.boxcox(x[~np.isnan(x)], lmbda=None)
   3275 
   3276         return lmbda

ValueError: not enough values to unpack (expected 2, got 0)
```

### Versions

```shell
System:
    python: 3.10.11 (main, Apr  5 2023, 14:15:10) [GCC 9.4.0]
executable: /usr/bin/python3
   machine: Linux-5.10.147+-x86_64-with-glibc2.31

Python dependencies:
      sklearn: 1.2.2
          pip: 23.0.1
   setuptools: 67.7.2
        numpy: 1.22.4
        scipy: 1.10.1
       Cython: 0.29.34
       pandas: 1.5.3
   matplotlib: 3.7.1
       joblib: 1.2.0
threadpoolctl: 3.1.0
```
```

COMMENT:
Since there is no reply, I'm going to open a PR that takes the second approach. The reason is that the second approach is clearer IMO and the first approach seems to trigger some unexpected behavior.

Labels: Bug, help wanted, module:preprocessing