From the actions in $d$ dimensions given by
$$S = \int d^dx \,\, \partial_{\mu}\phi \partial^{\mu} \phi + g \phi^k$$.
What is the condition that needs to be $k$ so that the theory is invariant under conformal transformations?
Initially, I have been trying to tackle the special case of pure scale transformations $x^{\prime}= \lambda x$. After putting in the transformed measure and fields as $d^d x^{\prime} = \lambda ^d d^dx$ and $\phi^{\prime}(\lambda x)= \lambda ^{-\Delta}\phi(x)$, I got the following equation
$$\lambda^{-2-2\Delta} + \lambda ^{-k \Delta}=\lambda^{-d}$$
Can I solve this in general for k, in terms of $\Delta$ and $d$. How do I find the scaling dimension of a theory, or is it a parameter?
And how do I solve the general case of any conformal transformation (including SCTs)?