I feel like this is a plot hole that no one really questions in Naruto. I also wish that it would've been explained in Minato's one-shot, now that I think about it. Assuming Minato taught himself how to use it, since the only other user was dead, how did he get access to it in the first place? It's not necessarily a Hiden (secret) or kinjutsu (forbidden), but given that the only other user was Tobirama himself, a renowned and powerful ninja from an equally renowned and powerful clan, how did someone like Minato, a rare genius from a clan of nobodies get his hands on it? I have a personal theory, but I would like to hear others in the comments as well.
If Minato was able to learn how to use the jutsu, it was presumably written down somewhere in a scroll that was probably highly protected in the Hokage Residence along with the Scroll of Seals. I originally assumed it would be in the Scroll of Seals, but that scroll only has kinjutsu, and Flying Raijin is not a kinjutsu. It must've been protected really well, considering someone like Orochimaru, who was able to get his hands on the Edo Tensei jutsu wasn't able to get Flying Raijin. I assume that Minato expressed interest in the jutsu and mentioned it to Jiraiya, who then took up Minato's request with Hiruzen. I would assume Hiruzen was probably skeptical at first, but given Minato's mission and exam records, and some convincing from Jiraiya, he relented and gave the scroll to Jiraiya, who the gave it to Minato. That's my personal theory.