All he knows about swordplay comes persumably from Orca, so eihter he learned them directly from him, or he suddenly remembered them from the other Link's incarnations. (Similar to how every Link can do a spinning slash right from the beginning, except MC!Link, who had to learn it from a sword master first (another fact that hints at the theory of Minish Cap being the chronologically first game)).