Calibration of the Cherenkov Telescope Array using cosmic ray electrons