The tangent complex is a complex of quasi-coherent sheaves on $Bun_G(X)$, i.e. a compatible family of complexes of quasi-coherent sheaves on every affine scheme $f:U\rightarrow Bun_G(X)$ (i.e. a $G$-bundle $P_0\rightarrow X\times U$) mapping smoothly.

The global sections $\Gamma(U, f^* T_{Bun_G(X)})$ of the tangent complex over $U$ is the complex associated to the Picard groupoid given by the fiber of $Hom(D\times U, Bun_G(X))\rightarrow Hom(\mathrm{pt}\times U, Bun_G(X))$, where $D=\mathrm{Spec}\ \mathbf{C}[\epsilon]/\epsilon^2$. Since this is a *Picard* groupoid, $\pi_0$ and $\pi_1$ are abelian groups, which are $H^0$ and $H^{-1}$ of the tangent complex.

One can explicitly describe this groupoid as follows: its objects are $G$-bundles $P\rightarrow X\times U\times D$ together with an isomorphism $P|_{X\times U\times\mathrm{pt}}\cong P_0$ on $X\times U$.

$\pi_1$ computed at the trivial bundle $P=P_0\times D$ is the group of $G$-equivariant automorphisms $P\rightarrow P$ which commute with the projection to $X\times U\times D$. This is precisely the space of vertical vector fields $\pi_1=H^0(X\times U, \mathrm{ad}\ P_0)$.

The computation of $\pi_0$ is trickier, let me just write down the answer: $\pi_0=H^1(X\times U, \mathrm{ad}\ P_0)$. The derivation relies on the fact that there are no deformations over an affine scheme, so you just have to pass to an affine cover of $X\times U$ (see Sam Raskin's notes for details).

So, on each affine $U$ mapping to $Bun_G(X)$ the tangent complex has cohomology computed by $\mathbf{R}\pi_*\ \mathrm{ad}\ P_0[1]$, where $\pi: U\times X\rightarrow U$. With some work one can show that the actual tangent complex $f^* T_{Bun_G(X)}$ is quasi-isomorphic to $\mathbf{R}\pi_*\ \mathrm{ad}\ P_0[1]$.

Finally, let me explain why this implies that the tangent complex on $Bun_G(X)$ is $T_{Bun_G(X)}=\mathbf{R} p_*\ \mathrm{ad}\ \mathcal{E}[1]$ for $p:Bun_G(X)\times X\rightarrow Bun_G(X)$. The point is that for nice morphisms of stacks $p$, $\mathbf{R} p_*$ can be defined by the usual pushforward for every base change to an affine scheme. See the proof of proposition 2.1.1 here.

To conclude, the canonical bundle is the inverse of the determinant of the tangent complex, i.e. $K=det(\mathbf{R} p_*\ \mathrm{ad}\ \mathcal{E})$.