A scalar field doesn't transform under a change of co-ordinates. Therefore, a scalar field $\phi(x)$ transforms to $\phi'(y)$ under the coordinate transformation $y^{\mu} = x^{\mu} + \epsilon^{\mu}(x)$, such that $\phi'(y) = \phi(x)$. Now, if we define $\delta \phi(x)$ to be the difference of the scalar field under the coordinate transformation at the same physical point, clearly $\delta \phi = 0$. However, if we define $\delta\phi$ as the difference at the same coordinate and not the same physical point, we obtain the following:
$$ \phi(x) = \phi(y^{\mu} - \epsilon^{\mu}) =\phi'(y)$$
$$\phi(y^{\mu}) - \epsilon^{\mu} \partial_{\mu}\phi(y) = \phi'(y)$$
Therefore, if we define $\delta \phi(x) = \phi(x) - \phi'(x)$, we arrive at $\delta \phi(x) = \epsilon^{\mu} \partial_{\mu}\phi(x)$. This is the result I was expecting. however, the lecture notes I'm following gives a completely foreign answer.
"Moreover, the part which contains the first derivatives $\partial_{\nu}\varepsilon^{\mu}(x)$ is also severely restricted. For instance, if $\varphi(x)$ is a scalar field, and we assume that it transforms undependently on other fields, we can write
$$\delta_\varepsilon \varphi(x)(x) = \varepsilon^{\mu}(x) \partial_{\mu}\varphi(x) + \frac{D}{d} (\partial_{\mu}\varepsilon^{\mu})\varphi(x)$$
where $d$ is the dimensionality of the space, and the parameter $D$ is related to the dimension of $\varphi$. This generalizes to more complicated scalar composite fields $\mathcal{O}_{\alpha}$ as follows
$$\delta_{\varepsilon} \mathcal{O}_{\alpha}(x) = \varepsilon^{\mu}(x) \partial_{\mu} \mathcal{O}_{\alpha}(x) + \frac{D^{\beta}_{\alpha}}{d} (\partial_{\mu}\varepsilon^{\mu}) \mathcal{O}_{\beta}(x) \\ + \ terms \ with \ \ \partial_{\nu} \partial_{\lambda} \varepsilon^{\mu}, \ etc.$$"
The transformation law has an additional $\phi(x)\partial_{\mu}\epsilon^{\mu}$ term. I just don't see how this term appears.