They just identify talented individuals and send them to schools in China or elsewhere to learn the latest tech.
The brightest students of most nations are often sent abroad to enrich their countries with knowledge from the great universities. NK is almost unique in its inability to do this at non-Chinese great universities, so that is the only viable route.
"North Korean hackers are sent vocationally to Shenyang, China for special training. They are trained to deploy malware of all types onto computers, computer networks, and servers."[3][4]
1: https://en.wikipedia.org/wiki/Koreans_in_China#North_Koreans...
2: https://web.archive.org/web/20090114201016/http://news.xinhu...
3: https://en.wikipedia.org/wiki/Lazarus_Group#Education
4: https://web.archive.org/web/20180621134306/https://www.scmp....