A generalized formulation of electronegativity equalization from density‐functional theory