Since there is no Timeline (of what i know) you can't really say when. But most peapol hou hawe tryd to meaik timelines put Ocarin of TIme as as the 1 or 2 and it's there that Link, Zelda and Ganondorf first get's there parts (power/wisdom/corage)
So the anser wode be: can't say or (as i too bealive) in Ocarina of time.
possibly it is in skyward sword. link IS the oldest in the sieres and it takes place before oot