Does parametrized Box Cox transform take degrees of freedom away from subsequent models? 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?

I'm inclined to say "yes", although it is not clear by how much the degrees of freedom have been effected.  I imagine those familiar with the concept of "phantom degrees of freedom" would categorize this as such.
The reason is because the data are used to estimate a parameter (the Box-Cox parameter), and we do not account for that use directly.  Were we to obtain new data from the same data generating mechanism, it is plausible that (because of sampling variability) we would get a different parameter value.  That uncertainty is not accounted for in most modelling frameworks.
