Arrange the chicken in an even layer in a large baking pan.
Sprinkle evenly with kosher salt. Cover and refrigerate for 1 to 2 hours. Rinse the chicken and pan thoroughly of salt, return the chicken to the baking dish along with the onion slices.
In a small bowl whisk together the buttermilk, beer and chili sauce, pour evenly over the chicken, cover and refrigerate for 8 to 24 hours.
In a medium sized bowl stir together the flour, black pepper, smoked paprika, garlic powder, chili powder and brown sugar.
One at a time remove the chicken legs, dredge in the flour mixture then gently re-dip in the marinade and recoat with the flour mixture (double coating of the flour mixture will give you a crispier chicken), set on a baking sheet.
Allow the coated chicken to sit at room temperature for 10 to 15 minutes.
At the oil to a large pot until about 6 inches deep, heat to 350 degrees using a cooking thermometer clipped to the pan, adjust heat to maintain that temperature.
Working in batches fry the chicken until golden brown and cooked through, about 12 minutes each.