Generalized framework for testing gravity with gravitational-wave propagation. II. Constraints on Horndeski theory