Separating accretion and mergers in the cosmic growth of black holes with X-ray and gravitational wave observations