Here’s a cartoon proof that, if the representation is unitary and finite dimensional, with Det=$+1$, then the trace of any generator is $0$. I’ll suppose the dimension is $3$ for clarity but this is adaptable to any dimension.
We can without loss of generality suppose the group element $g$ is brought to diagonal form in the irrep $\Gamma$: $$ \Gamma(g)= \exp(-i \alpha \hat T)=\hat 1-i\alpha\hat T+\ldots $$ for some diagonal $\hat T$ where $$ \hat T=\left(\begin{array}{ccc} T_{11}&0&0\\ 0&T_{22}&0\\ 0&0&T_{33}\end{array}\right)\, . $$ Since $\text{Det}(\Gamma(g))=1$, we have \begin{align} 1&=\text{Det}\left(1-i\alpha \left(\begin{array}{ccc} T_{11}&0&0\\ 0&T_{22}&0\\ 0&0&T_{33}\end{array}\right)-\frac{\alpha^2}{2} \left(\begin{array}{ccc} T^2_{11}&0&0\\ 0&T^2_{22}&0\\ 0&0&T^2_{33}\end{array}\right)+\ldots\right)\, ,\\ &=1-i\alpha (T_{11}+T_{22}+T_{33})+{\cal O}(\alpha^2) \end{align} from which $T_{11}+T_{22}+T_{33}=0$.
This also clearly works if $\Gamma(g)$ is not diagonal, although the bookkeeping is messier. If
If $\Gamma$ is not unitary, then the assumption $\Gamma(g)$ is the exponential of a Hermitian operator is invalid, but the strategy may still work. If the irrep is a direct sum of irreducible this probably also work. If the irrep is indecomposable I don’t think. If the group is not simply connected I don’t know either. Clearly the exponential maps enters into this but I’m weary of pitfalls and assumptions that are common in most examples in physics.