There is no exact way to generate primes continuously.
Though there is ways better than others. That's why almost all the big primes we find nowadays are Mersenne primes, which are primes of the form
$$2^p-1$$
where $p$ is also a prime number. We do that because Mersenne numbers have a very efficient criteria to determine whether or not they are prime. It is called Lucas primality test.
For Lucas primality test, you take a Mersenne number, and you have to check that:
$$\forall q\mid p-1,\quad 2^{(p-1)/q}\
ot\equiv 1 \pmod p.$$
If a number passes the test, then it is a prime number.