Cosmic ray anisotropy as signature for the transition from galactic to extragalactic cosmic rays