def METHOD_NAME(self, y, X=None):
    """Fit the transformer
    Learns the value of ``lmbda``, if not specified in the constructor.
    If defined in the constructor, is not re-learned.
    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.
    """
    lam1 = self.lmbda
    lam2 = self.lmbda2
    if lam2 < 0:
        raise ValueError("lmbda2 must be a non-negative scalar value")
    if lam1 is None:
        y, _ = self._check_y_X(y, X)
        _, lam1 = stats.boxcox(y + lam2, lmbda=None, alpha=None)
    self.lam1_ = lam1
    self.lam2_ = lam2
    return self