Denoting the integral as $I = \int^\infty_a x\big(1-e^{-x^{-a}}\big) \, \mathrm{d}x$, we can take the substitution $t = x ^{-a}$. We get $\mathrm{d}t = -\frac{a}{x^{a+1}}\mathrm{d}x$ which gives
$$
I = \frac{1}{a} \int_{0}^{a^{-a}}\frac{1 - e^{-t}}{t^{1 + \frac{2}{a}}} \mathrm{d}t = \frac{1}{a}\int_{0}^{a^{-a}}\left( 1 - e^{-t}\right)\left(-\frac{a}{2t^{\frac{2}{a}}} \right)' \mathrm{d}t
$$
The above integral is in perfect form to apply integration by parts. We thus get
$
\require{\cancel}
$
$$
I = \frac{1}{\cancel{a}} \left[\frac{\cancel{a}}{2}\left(\frac{e^{-t} -1}{t^{\frac{2}{a}}} \right)\Bigg\vert_{0}^{a^{-a}} + \frac{\cancel{a}}{2} \int_{0}^{\color{purple}{a^{-a}}} t^{\left(\color{blue}{1 - \frac{2}{a} }\right)-1} e^{-t} \, \mathrm{d}t\right]
$$
Recalling that the lower incomplete Gamma function is given by
$\gamma(\color{blue}{\alpha},\color{purple}{x}) :=\int_{0}^{\color{purple}{x}}t^{\color{blue}{\alpha}-1}e^{-t} \, \mathrm{d}t$
we get
$$
I = \frac{a^2}{2}\left(e^{-a^{-a}} -1 \right) +\frac{1}{2}\underbrace{\lim_{t \to 0^{+}} \frac{1-e^{-t}}{t^{\frac{2}{a}}}}_{\color{green}{L}} +\frac{1}{2}\gamma\left( 1 - \frac{2}{a}, a^{-a}\right)
$$
We just need to evaluate the limit $L$ to conclude the problem, and this is the part that will give us the restriction on the possible values of $a$. By applying L'Hôpital's rule we get
$$
L = \frac{a}{2}\lim_{t \to 0^{+}} \frac{e^{-t}}{t^{\color{red}{\frac{2}{a}-1}}}
$$
And here the value of the limit entirely depends on if ${\color{red}{\frac{2}{a}-1}}$ is positive, negative or $0$. If $\frac{2}{a}-1>0$, then we have a $\frac{1}{0}$ situation and the limit is infinity, so
$I$ diverges. If we have $\frac{2}{a}-1= 0 $ then $\gamma\left( 1 - \frac{2}{a}, a^{-a}\right) = \gamma(0,2^{-2})$ diverges, so here $I$ again diverges. If $\color{brown}{\frac{2}{a}-1< 0}$ then $\frac{1}{t^{\frac{2}{a}-1} }\to 0$ as $t \to 0^+$and thus $ L = 0$. We can finally conclude that
$$
I = \boxed{\frac{a^2}{2}\left(e^{-a^{-a}} -1 \right) +\frac{1}{2}\gamma\left( 1 - \frac{2}{a}, a^{-a}\right), \quad \color{brown}{a > 2}}
$$