Coevolution of teaching ability and cooperation in spatial evolutionary games