A Büchi-Elgot-Trakhtenbrot theorem for automata with MSO graph storage