The reason they were there was to represent the water and the blood.
Elijah, the water, and Moses, the blood.They were standing along with Jesus as The Two Witnesses.Which are the covenants.
So on Mount Tabor you have the Spirit(Jesus) water(Elijah) and blood. (Moses)
The first shall be last,and the last first.
Moses(blood) was before Elijah.(water) Get it?
Matthew 17:5
While he yet spake, behold, a bright cloud overshadowed them: and behold a voice out of the cloud, which said, This is my beloved Son, in whom I am well pleased; hear ye him.
Revelation 19:10
And I fell at his feet to worship him. And he said unto me, See thou do it not: I am thy fellowservant, and of thy brethren that have the testimony of Jesus: worship God: for the testimony of Jesus is the spirit of prophecy.
Some people say "so and so are the Two Witnesses because they represent the Law and the Prophets"
At the end of that road it all leads to his covenants.His Two Witnesses.They were there at the transfiguration of Jesus.And will be there at the transfiguration of the 144,000.Who will give the testimony of The Two Witnesses.And those who hear,and believe will be transfigured.
Moses represents the law, and Elijah the prophets.
The Bible speaks of 2 beings standing before the LORD of all the Earth which they are probably Moses and Elijah for they are the 2 most important figures representing the law and prophets besides Jesus.
Which John the Baptist came in the spirit of Elijah, and born of woman there is not a greater than John the Baptist besides Jesus.
Which the Catholic Church gives reverence to Mary but John the Baptist is considered greater than her so where is his reverence.
It is obvious when the Roman Empire embraced Christianity that they did not get rid of their pagan and occult ways but held on to them, and it became their foundation for interpreting scriptures and pagans have a female deity so they have one.
Joseph Smith had a belief that was not part of the Bible and it became his foundation of the interpreting of scriptures the Mormon church.
Same as the seriously flawed churches, Scientology, Christian Science, which are probably forerunners to the new age movement that will eventually deceive the world to follow the New Age Christ and they will stop the preaching of the Gospel, and the belief in a God, on a world wide scale, and then God will end sin on Earth.
They are probably the 2 witnesses that will witness to Israel to turn them to the truth that Jesus is their Messiah.
That is probably why they were at the transfiguration because they are the 2 candlesticks that stand before the LORD of all the Earth.