Spatially modulated electronic nematicity in the three-band model of cuprate superconductors