Soak the bacalao in cold water in the refrigerator for at least 24 hours, changing the water several times to desalinate it. Place the bacalao in a saucepan with cold water and 2 bay leaves. Bring to a simmer over medium heat and cook for 10-15 minutes. Drain in a colander, reserving the bay leaves.
Tear the drained bacalao into small pieces by hand, removing the bones but retaining the skin. Set aside.
Cut the 2 large onions into rings. Heat olive oil in a pan over medium heat. Add the onions and reserved bay leaves, cooking until the onions are golden yellow. Add the piri-piri, pepper, and wine, continuing to cook until the liquid evaporates. Remove the bay leaves and add the shredded bacalao, heating for 2 minutes. Pour the juice of half a lemon over the mixture and set aside.
Peel the 750 g of potatoes and cut into thin sticks. Heat olive oil in a pan over medium-high heat. Fry the potatoes until almost tender with a slight firmness remaining. Add salt to taste and set aside. Preheat the oven to 200°C (392°F).
Warm the 1½ cup milk in a small saucepan over low heat. In another saucepan, melt the 3 teaspoons of butter over low heat. Add the 4½ teaspoons of flour and stir constantly with a whisk for 2 minutes. Gradually pour in the warmed milk while stirring constantly. Increase heat to medium and continue stirring until the mixture thickens. When it comes to a boil, remove from heat. Season with salt, pepper, and nutmeg to taste. Fold in the 1 cup whipped cream and 1 tablespoon crème fraîche.
Grease a baking dish with the fat. Layer the fried potatoes and the onion-fish mixture in the dish. Pour the béchamel sauce over top. Sprinkle breadcrumbs over the sauce. Bake in the preheated oven at 200°C (392°F) for 20 minutes until golden. Serve with wine or beer.