I onced played in a facilitated band with multiple guitarists. The instructor noticed my struggles with timing and finally had me switch to bass. That forced me to lock in with the drummer and be in time. Personally as I learn a new song I first try to just listen to just the drums and try to tune out the guitar. My timing on guitar improved dramatically. Tapping your foot can help a lot. Gives you a physical connection to the beat. Also, practicing a piece very slowly and not speeding up until you can lock in the beat. Just my experience, for what its worth.
Mike