The Box-Cox transform has two parameters that equate to a shift $\alpha$ and a power $\lambda$. Implementations such as scipy.stats.boxcox
have the option of either being given $\lambda$ or finding an optimal choice of $\lambda$ by minimizing the negative log-likelihood of the transformed variables using a normal distribution.
Let says I have two variables $X$ and $Y$. I would like to perform a regression using function $f$ between their Box-Cox transforms $T(X; \lambda_1)$ and $T(Y; \lambda_2)$ having optimized $\lambda_1$ and $\lambda_2$ toward the transformed variables being normal.
Whether I train the Box-Cox parameters simultaneously with $f$ or perform the Box-Cox optimization and then perform the regression of $f$, have I influenced the degrees of freedom of my model?