There can be more than one answer for this.
We know the disciples recognized Elijah and Moses.
This alone gives more credence to the stature of Jesus. Jesus’ father then spoke in verse 7 telling the disciples to listen to him. This is a second reason for the disciples to understand the importance of obeying Jesus.
There is also a possible third answer which has a clue in verse 1. Jesus stated that there were some there that would see the kingdom of God in power. The transfiguration of Jesus most likely was a future vision of him in kingdom glory. Talking with Elijah and Moses gives us the clue that it is a future vision because before Jesus, no one was raised from death to everlasting life. But that changes with the beginning of God’s kingdom rule over the earth.
Another possible answer is that not only was it a futuristic vision but a symbolic one as well. The figurative Moses and Elijah can represent the two groups that make up the bride as mentioned in Revelation. One group basically gets things going as Moses did. The second group straightens worship as Elijah did. Both individuals or groups would be servants of Christ in kingdom glory.