A molecular orbital model for the electronic structure of transition metal atoms in silicate and aluminate alloys