There's a straightforward abstract answer that you may not like, but, because it clarifies your question and explains a uniform way to answer similar questions, I'll sketch it here. First, consider a simpler problem of this kind: Suppose that you want to describe the group of isometries of a Riemannian metric $\rho$ on a Riemannian $n$-manifold $M$. By definition, a mapping $f:M\to M$ is an isometry if and only if $f^*(\rho)-\rho =0$, so you could define the operator $T(f) = f^*(\rho)-\rho$, which takes smooth maps $f$ to sections of $S^2(T^*M)$, and note that $T(f)=0$ if and only if $f$ is an isometry, and, moreover, if $g:M\to M$ is an isometry and $f:M\to M$ is any mapping, we have $$ T(g\circ f) = (g\circ f)^*(\rho)-\rho = f^*\bigl(g^*(\rho)\bigr)-\rho = f^*(\rho)-\rho = T(f). $$ Thus, the differential operator $T$ satisfies the conditions that you want for detecting the group of isometries of $\rho$. Now, consider the slightly more difficult but still manageable case of affine transformations: Let $(M,\alpha)$ be a manifold endowed with a (torsion-free) affine connection $\alpha$. Now, torsion-free affine connections, unlike Riemannian metrics, are not given by specifying a section of a natural *vector* bundle over $M$. Instead, there is a natural *affine* bundle over $M$, call it $\mathsf{A}(M)$, that is modeled on the natural vector bundle $TM\otimes S^2(T^*M)$, whose sections define the torsion-free affine connections on $M$. The bundle $\mathsf{A}(M)$ is natural in the sense that, if $f:M\to M$ is any diffeomorphism, there is an induced canonical bundle isomorphism $\mathsf{A}(f):\mathsf{A}(M)\to \mathsf{A}(M)$ such that $\mathsf{A}(f)\circ\alpha$ is a section of $\mathsf{A}(M)$ that represents the connection $\alpha$ pulled back via $f$. We also have $\mathsf{A}(g\circ f) = \mathsf{A}(f)\circ \mathsf{A}(g)$, as the canonical map is contravariant. Now, the answer to the problem of characterizing the symmetries of an affine structure $\alpha$ on $M$ has a reasonable answer: Simply set $$ T(f) = \mathsf{A}(f)\circ\alpha - \alpha, $$ and this will have all the properties that you want. Note that, because $\mathsf{A}(M)$ is modeled on the vector bundle $TM\otimes S^2(T^*M)$, the nonlinear differential operator $T$ takes values in the *vector* bundle $TM\otimes S^2(T^*M)$. When you unravel this for $M=\mathbb{R}^n$ and $\alpha = \alpha_0$, the standard flat affine structure on $\mathbb{R}^n$, you get the expression you wrote down above in local coordinates. Finally, let's come to the case of a manifold of dimension $n>1$ (the case $n=1$ is different) with a (torsion-free) *projective* structure $(M,\pi)$, where, now, $\pi$ is a section of a natural affine bundle $\mathsf{P}(M)$, that is modeled on the the vector bundle $\mathsf{Q}(M)$ that fits into the natural exact sequence $$ 0\longrightarrow T^*M\longrightarrow TM\otimes S^2(T^*M)\longrightarrow \mathsf{Q}(M)\longrightarrow 0. $$ (Note that $\mathsf{Q}(M)$ is a vector bundle of rank $\tfrac12n(n{-}1)(n{+}2)$. The fact that this rank is $0$ when $n=1$ is why the case $n=1$ is different. Indeed, in dimension $1$ every $2$-jet of a diffeomorphism is the $2$-ject of a projective transformation, so you have to go to $3$-jets to get an equation.) Again, if $f:M\to M$ is any diffeomorphism, there is a canonically induced bundle mapping $\mathsf{P}(f):\mathsf{P}(M)\to \mathsf{P}(M)$, and these bundle maps satisfy $\mathsf{P}(g\circ f) = \mathsf{P}(f)\circ \mathsf{P}(g)$. Now, again, the solution to your problem of characterizing the diffeomorphisms $f:M\to M$ that preserve a given torsion-free projective structure $\pi$ is to define $$ T(f) = \mathsf{P}(f)\circ\pi - \pi, $$ and this operator $T$, taking a diffeomorphism $f:M\to M$ to a section of $\mathsf{Q}(M)$ (since the difference of two sections of $\mathsf{P}(M)$ lies in $\mathsf{Q}(M)$), has all the properties that you want. When you write this out in local coordinates, this gives the (second-order) partial differential equations that characterize projective transformations. Essentially, this approach goes back to Sophus Lie in the 19th century, but it was considerably clarified by the work of Élie Cartan early in the 20th century, in his works on what we would now call Lie pseudo-groups of transformations.