Let $x=t+t^{-1}$ in $y=x^3-3x-1$. So we have $$\left(t+\frac {1}{t}\right)^{3}-3\left(t+\frac {1}{t}\right)-1=0$$
Expanding that and simplifying, we get $\dfrac {t^{6}-t^{3}+1}{t^{3}}$ and multiplying both the numerator and the denominator by $t^3+1$ we get $\dfrac {t^{9}+1}{t^{3}(t^{3}+1)}$.
We let $t=\cos(\alpha)+i\sin(\alpha)$ and we get $\cos(9\alpha)+i\sin(9\alpha)=-1$. Equating terms, we get $$\begin{cases}\cos(9\alpha)=-1\\\sin(9\alpha)=0\end{cases}$$
From there, we see that $\alpha=\dfrac {2k\pi+\pi}{9}$ for $k=0,2,3\ldots$. We want the real part so we have $$e^{\frac {2k\pi+\pi}{9}i}+e^{-\frac {2k\pi+\pi}{9}i}=2\cos\left(\frac {2k\pi+\pi}{9}\right)$$ for $k=0,2,3\ldots$.
You could also use Vieta's trigonometric formula to find the roots.
Given the equation $x^3+ax^2+bx+c$, one can find the roots by finding $p$ and $q$ where $$p=\frac {3b-a^2}{9}$$$$q=\frac {9ab-27c-2a^3}{54}$$
The roots are given in $$\begin{cases}x_1=2\sqrt{-p}\cos\left(\frac {\theta}{3}\right)-\frac {a}{3}\\x_2=2\sqrt{-p}\cos\left(\frac {\theta+2\pi}{3}\right)-\frac {a}{3}\\x_3=2\sqrt{-p}\cos\left(\frac {\theta+4\pi}{3}\right)-\frac {a}{3}\end{cases}$$
where $\cos\left(\frac {\theta}{3}\right)=\frac {q}{\sqrt{-p^3}}$.