Before stating anything, it is important to understand that legionaries came from all over the empire. There may have been religious or cultural traditions specific to that individual. That being said, there were some general services.
All legionaries contributed a portion of their pay toward a funerary fund managed by the centurion of his cohort. This fund covered funeral expenses if death happened during service. The body would be carried out of the fort grounds on a couch and set on a funeral pyre. Often the location was somewhere visible, perhaps the road leading to the fort.
Once reduced to ash, the remains would be gathered in a funerary urn made of glass, pottery, or marble for the more wealthy. The urn was then interred at the grave while friends and family participated in a funeral banquet.
The legionary may have set aside funds for the gravestone, which often listed the name, service history, commendations received, among other information. The more elaborate were carved with likenesses and painted. The gravestone of Marcus Favonius Facilis from Colchester, UK is a great example.
If it was after a major battle, there would be a large, general pyre for all the deceased.
Hope this answers your question. If you are interested in this period, check out the work of Adrian Goldsworthy, Peter Connolly, and Graham Webster.
Edit: The activities would not have differed much after retirement to a colonia, except the legionary would cover their own expenses. In fact, the gravestone linked above is from a colonia.