A Unified Gravity-Electroweak Model Based on a Generalized Yang-Mills Framework