Upon complexation, the formal charge on both on both nitrogen and oxygen will be +1. In case of nitrogen and due to neighboring pi bond, there are two resonating structures with the positive charge resonating between nitrogen and alpha carbon. In case of oxygen, the the positive charge is localized. This gives, besides electronegativity and steric considerations, more stability to coordination via nitrogen. Notice also that the nitrogen coordination site , being sp2 hybridized, is planar whereas the oxygen site, being sp3 hybridized, is tetrahedral with a more steric factor.