def METHOD_NAME(self, X, y=None):
    """Transform X and return a transformed version.
    private _transform containing the core logic, called from transform
    Parameters
    ----------
    X : pd.Series or pd.DataFrame
        Data to be transformed
    y : ignored argument for interface compatibility
        Additional data, e.g., labels for transformation
    Returns
    -------
    theta_lines: pd.Series or pd.DataFrame
        Transformed series
        pd.Series, with single Theta-line, if self.theta is float
        pd.DataFrame of shape: [len(X), len(self.theta)], if self.theta is tuple
    """
    theta = _check_theta(self.theta)
    forecaster = PolynomialTrendForecaster()
    forecaster.fit(y=X)
    fh = ForecastingHorizon(X.index, is_relative=False)
    trend = forecaster.predict(fh=fh)
    theta_lines = np.zeros((X.shape[0], len(theta)))
    for i, theta_i in enumerate(theta):
        theta_lines[:, i] = _theta_transform(X, trend, theta_i)
    if isinstance(self.theta, (float, int)):
        return pd.Series(theta_lines.flatten(), index=X.index)
    else:
        return pd.DataFrame(theta_lines, columns=self.theta, index=X.index)