Response functions and charge transition densities for monopole excitations in (e,e') and (e,e'x) reactions of 16O and 40Ca