def METHOD_NAME(self, y, X=None, **kwargs):
    """Transform the new array
    Apply the Box-Cox transformation to the array after learning the
    lambda parameter.
    Parameters
    ----------
    y : array-like or None, shape=(n_samples,)
        The endogenous (time-series) array.
    X : array-like or None, shape=(n_samples, n_features), optional
        The exogenous array of additional covariates. Not used for
        endogenous transformers. Default is None, and non-None values will
        serve as pass-through arrays.
    Returns
    -------
    y_transform : array-like or None
        The Box-Cox transformed y array
    X : array-like or None
        The X array
    """
    check_is_fitted(self, "lam1_")
    lam1 = self.lam1_
    lam2 = self.lam2_
    y, exog = self._check_y_X(y, X)
    y += lam2
    neg_mask = y <= 0.
    if neg_mask.any():
        action = self.neg_action
        msg = "Negative or zero values present in y"
        if action == "raise":
            raise ValueError(msg)
        elif action == "warn":
            warnings.warn(msg, UserWarning)
        y[neg_mask] = self.floor
    if lam1 == 0:
        return np.log(y), exog
    return (y ** lam1 - 1) / lam1, exog