Season the chicken legs with salt and some of the curry powder. Reserve the remaining curry powder. Heat margarine in a large pot over medium-high heat. Brown the chicken legs on all sides for about 10 minutes.
While the chicken browns, peel and dice the onions and apples.
Remove the browned chicken from the pot and set aside. Add the diced onions and apples to the remaining fat in the pot. Cook over medium heat for 5 minutes, stirring frequently.
Stir in the tomato paste. Sprinkle the flour and reserved curry powder over the vegetables. Cook for 2-3 minutes, stirring constantly, until fragrant.
Pour in the hot chicken broth and return the chicken legs to the pot. Bring to a simmer over medium heat, then reduce heat to low. Simmer for 45 minutes, until the chicken reaches 74°C / 165°F internally.
Season the sauce with lemon juice and a pinch of sugar to taste.