I learned the note sequences of all the major scale by going through them in my head at bus stops. Similarly you can learn chord formulae and practice naming the notes, then visualise them on the fretboard e.g. major = R-3-5, so D = D-F#-A, Eb = Eb-G-Bb