Generalized framework for testing gravity with gravitational-wave propagation. I. Formulation | Synapse