\$\begingroup\$

MATL, 16 bytes

2iq:"t`Qtt:\~z2>

This uses current release (10.1.0) of the language/compiler.

Try it online!

Explanation

This uses two nested loops. The outer one produces each prime, and the inner one increases 1 by 1 from latest found prime until the next prime is found.

To test for primality a modulo operation is used: x is prime if computing mod(x,k) for k=1,2,...,x produces no more than two zeros; that is, if only two numbers of the set 1,2,...,x divide x .