I know Virgil composed the epic in order to provide a legitimizing foundation story for Rome, but was he creating the story himself or basing it off some older story or oral tradition other than? Other than what the Iliad mentions of Aeneas and the similarities it shares with the Odyssey.
You've posed an either-or question there - did Virgil create the story or build it off some older oral tradition? I'm afraid the simple answer is 'yes' - but luckily it gets more interesting than that.
It's important to realise that just about every narrative work of Classical literature is based on an existing story from oral tradition.^(1) The Iliad and Odyssey are no different: you can really think of them as focused, 'literarified' excerpts from much bigger bodies of oral tradition. This becomes obvious when you look at how both texts make reference to other stories without fully explaining them - the audience is expected to have heard these tales and to know about them, sometimes in reasonable detail. For example, in Iliad 4, Diomedes' charioteer mentions the story of the Seven Against Thebes to prove his courage to Agamemnon, while Odysseus briefly sees the shade of Heracles in Odyssey 11. Indeed, the Iliad doesn't really 'work' as a piece of literature unless you know the story - there's only the briefest allusion to the Judgement of Paris, and therefore the cause of the whole war, right at the end of the poem, and you absolutely need to know that Achilles will die and that Troy will fall in order to appreciate the force of some of its most emotionally charged moments. Neither happens in the Iliad.
Part 1: Aeneas the Trojan Hero
As your question alludes, the myth of Aeneas goes back at least as far as the Iliad, and it has been suggested that his presentation in the poem owes something to 'rival' epic traditions about Achilles and Aeneas.^(2) Even in the Iliad, we are told that Aeneas will survive and go on to lead the Trojans - as Poseidon saves him from Achilles' wrath in Book 20:
Why should an innocent man, who always makes fine offerings to us rulers of the heavens, suffer harm because of another’s quarrel? Let us rescue him, and avoid Zeus’s anger were Achilles to kill him, for Aeneas is destined to live on, so that Dardanus’ race itself might survive, Dardanus whom Zeus loved above all his children by mortal women. The Son of Kronos has come to hate Priam’s line, and mighty Aeneas will be the Trojan king, as his descendants will in time to come.’
Of course, there's no mention of Rome or Italy here - in fact, plenty of the extra-Iliadic Greek references to this story (such as in the Homeric Hymn to Aphrodite - not of the same authorship as the Homeric poems) refer to Aeneas 'ruling in Troy', which rules out any sort of emigration. The topos here of the 'one righteous man' being saved from the apocalyptic destruction of a city is truly ancient, and the Aeneas episode in the Iliad owes its form to some very ancient trends in Near Eastern mythology that we see pop up in, for instance, the Sumerian Epic of Gilgamesh and in the story of Sodom and Gomorrah in the Old Testament.^(3)
The Aeneas legend was, therefore, well known to Virgil - and key set-piece moments of the Aeneid were already familiar within that tradition. As early as the late 5th century, Sophocles described Aeneas' rescue of Anchises from Troy in his now-lost tragedy Laocoon, and Xenophon was able to make a casual reference in the prologue to his Cynegeticus ('On Hunting with Dogs'), only a few decades later, to how Aeneas 'rescued the gods of his father's and his mother's family, and with them his father himself'. We also see the scene depicted on Archaic Greek art, such as this vase (now in the Met) from 525-500 BC, and occasionally on Etruscan gems.^(4)
This provides us with a good starting point to what Virgil is doing in the Aeneid - in each of these cases, the main focus is Aeneas' rescue of his father, and therefore the filial loyalty that this represents. Even a very quick reading of the Homeric poems will clue you in to the importance of that relationship - on the wall of my classroom, I have a word-frequency cloud made up from an English translation of the Iliad, and it's no coincidence that 'Son' stands massively in the middle of it. However, Virgil shifts the emphasis. Aeneas' devotion to his father is important to him, but he's equally concerned with what Aeneas represents for the future - and therefore gives at least equal 'screen-time' to his son, Ascanius, and the statues of the gods that he brings out. Moreover, he calls these the penates, which are a distinctively Roman idea - the 'small gods' of the household and state that formed a major part of Roman belief but had no parallel in Greek culture.
What we can see here is that Virgil works with an existing oral and literary tradition, but isn't blindly copying it down - he adapts and shifts it to suit his own artistic, political and ideological ends. It's also important to note that Virgil outright rejects parts of the legend that don't fit his project - several fragmentary Greek sources have Aeneas being taken captive by Neoptolemus, Achilles' son, and taken to Epirus; while Aeneas does visit Epirus in the Aeneid, he does so in triumph as the leader of the Trojans. In another version, preserved by the fourth-century Menecrates of Lycia, Aeneas only escaped Troy because he was the one who allowed the Greeks in, and so they allowed him to live. Oral tradition is, almost by nature, multi-headed, fragmentary and contradictory - even a writer who wanted to simply record the narrative as passed down would have to make judgements about which version was more trustworthy, or how to reconcile the various partial narratives into something coherent.