First we should be looking at one thing, is this really only Time Travelling or is this a Multiple Universes.
Multiple Universes really makes things much simpler, there is one YMX that for some reason is training under a foreteller(maybe) with Young Eraqus, and there is another that it is still stuck Destiny Island.
In the Time Travelling, i think there is not enough information to understand it, for all we know it could be very similar to Sora's beginning, that Destiny Island was engulfed in darkness during his living there, somehow he gets a Keyblade, ultimately he still gets engulfed and he survives in another world with the help of the Keyblade, after that he encounters a foreteller that makes him his apprentice along with Eraqus(if he wasn't sent there the moment he got swallowed). Now YMX is enamored with the Keyblade and it's legends, why did it save him or w/e, the more he discovered it the more it made him decent into darkness, in his path to become the MX we all know and love, he discovered another method(or used the same old method, don't remember its requirements) that got him back in time, this time, he stops Destiny Island from being engulfed, but noticing he can't stay for long he leaves leaving the YMX this new timeline were he wishes to get out of the Island.
So yeah, that is probably a load of bullshit that i just wrote, but it might make some sense just because of the nformation we have on what happened in the past