As a duty of children, how to transfer merits to parents after their death?
Give an alms giving to monks dedicated to your parents and ask them to perform the ceremony. It will look something like this http://buddhistbugs.blogspot.com/2011/03/transference-of-merits-to-departed-ones.html?m=1
This is a very good question. Although some background info is needed first.
When you act, think and speak in Raga, Dosa and Moha at a fundamental level something extraordinary happens.
You get entangled in a "debt" (Naya) transaction with the other party. In the Sansaric journey the ones who come to harm and create difficulties are those whom you owe a debt. The ones who come to help are the opposite. They owe owe you a debt.
When someone is born he/she awaits in Ghandabba state until a mother with a debt transaction is found. Some parents cannot get pregnant. This means at the time of conception there was no one with a debt transaction in a Ghandabba state.
The obedient children owes the mother a debt. The difficult ones come asking for a "repayment".
There is no Nibbana until ALL debts are settled. Although what typically happens is the person gets entangled in many more debts again while settling one debt.
The Buddha advises thus, "Yo Dhammo, Yo Vinayo" -> conduct every moment cognizing the cause-and-effects of your actions while freeing yourself from Sansaric debts.
Naya (debt) -> (opp) Vi-naya (freeing from debt)
Thus, your relatives are someone whom you have a debt transaction. The way you free yourself from these debts is by giving away merits to them (departed and living).The departed relatives in the Peta/Boota realms await until you free them.
What you do is establish a clean mind first without Raga, Dosa and Moha. Then imagine giving away the merits you have collected to those relatives.
Think and imagine "take these merits and I free you from all debts owing. I implore you to free me from debts owed". Give away without expecting nothing in return. Make sure to be incredibly genuine (බොක්කෙන්ම කල යුතුයි) when doing so.
The example the Buddha gives is do so as if pouring water from one vessel to another.
You have a large mountain of merits (පින්) you have collected. Giving them away helps you to attain Kusal thus Nibbana and also frees you from Sansaric debts.
There are other times you can get burdened with the debt too. Essentially, when you do not take care of your responsibilities towards society, family and even nature you get into debt too.