One of the prayers that the Prophet (sws) is reported
to have made while visiting a graveyard was in these words:
Peace be on
you, O! the residents of graves. May God forgive you. You have preceded us and
we are following your footsteps. (Tirmadhi, No: 1053)
Since graves of relatives are an effective reminder of death,
the Prophet (sws) encouraged believers to visit them frequently. Of course,
prayers were also rendered for the forgiveness of the dead and for raising their
status in the Afterlife.
What I may have emphasized is that no prayer of the Prophet (sws)
for the dead contains a mention that indicates that he asked the Almighty to
transfer any of his own deeds in favour of any deceased person. That is
something completely against the principles of Islam. And Allah knows best.