Non-autonomous Cauchy problems governed by forms: maximal regularity and invariance