def METHOD_NAME(self, X, y=None):
    """Transform X and return a transformed version.
    private _transform containing core logic, called from transform
    Parameters
    ----------
    X : time series or panel in one of the pd.DataFrame formats
        Data to be transformed
    y : time series or panel in one of the pd.DataFrame formats
        Additional data, e.g., labels for transformation
    Returns
    -------
    transformed version of X
    """
    coerce_to_type = self.coerce_to_type
    ix_source = self.ix_source
    level = self.level
    def is_date_like(x):
        return is_datetime64_any_dtype(x) or is_period_dtype(x)
    if ix_source == "y" and y is not None:
        X = y
    if level is None:
        level = -1
    X_only_ix = X.drop(columns=X.columns)
    if X.index.names[-1] is None:
        newcols = list(X_only_ix.index.names)
        newcols[-1] = "index"
        X_only_ix.index.names = newcols
    X_ix_in_df = X_only_ix.reset_index(level=level)
    X_ix_in_df.index = X.index
    if coerce_to_type == "auto":
        cd = {col: X_ix_in_df.dtypes[col] for col in X_ix_in_df.columns}
        coerce1 = {d: "int64" for d in cd if is_date_like(cd[d])}
        coerce2 = {d: "float64" for d in cd if is_date_like(cd[d])}
        X_ix_in_df = X_ix_in_df.astype(coerce1)
        X_ix_in_df = X_ix_in_df.astype(coerce2)
    else:
        X_ix_in_df = X_ix_in_df.astype(coerce_to_type)
    return X_ix_in_df