Not long ago I went ina small discussion with someone else regarding this point. The first time I played TP I honestly didn't think much of it and I figured it was when she was kidnapped, but playing again I realised Link is the one that gets hit really bad in the head, not Ilia.
Furthermore Impaz know Link's name because Ilia would talk to her about her friend, which means she got her amnesia sometime after she pass through the hidden Village.
So, when and why did you think Ilia had amnesia?
Another thing to point out is the item that helps her remember you.