In a medium saucepan, combine the sugar and water. Bring to a boil over medium heat, stirring occasionally until the sugar is completely dissolved.
Reduce the heat to low and let the syrup simmer for about 5 minutes, until it thickens slightly.
Stir the grated coconut into the syrup. Continue to cook over low heat, stirring constantly, until the mixture thickens and most of the liquid has evaporated. This should take about 10-15 minutes.
In a small bowl, lightly beat the egg yolks. Slowly temper the egg yolks by adding a few spoonfuls of the hot coconut mixture into the yolks while stirring continuously. This prevents the yolks from curdling.
Gradually pour the tempered egg yolks back into the saucepan with the coconut mixture, stirring constantly. Cook over low heat for another 5-7 minutes, until the mixture becomes thick and glossy.
Stir in the ground cinnamon, ground cloves, vanilla extract, and lemon zest (if using).
Remove the saucepan from the heat and let the cocada amarela cool slightly.
Spoon the mixture into serving dishes or a large serving bowl. Allow it to cool completely to room temperature, then refrigerate for at least 2 hours before serving.
Before serving, you can sprinkle a little extra ground cinnamon on top for garnish.
Enjoy your meal!