In the broad subclass of Horndeski theories with a luminal speed of gravitational waves, we derive gravitational waveforms emitted from a compact binary by considering the wave propagation on a spatially flat cosmological background. A scalar field nonminimally coupled to gravity gives rise to hairy neutron star (NS) solutions with a nonvanishing scalar charge, whereas black holes (BHs) do not have scalar hairs in such theories. A binary system containing at least one hairy neutron star modifies the gravitational waveforms in comparison to those of the BH-BH binary. Using the tensor gravitational waveforms, we forecast the constraints on a parameter characterizing the difference of scalar charges of NS-BH or NS-NS binaries for Advanced LIGO and Einstein Telescope. We illustrate how these constraints depend on redshift and signal-to-noise ratio, and on different possible priors. We show that in any case it is possible to constrain the scalar charge precisely, so that some scalarized NS solutions known in the literature can be excluded.