I knew a drummer who slept with a ticking metronome.
One trick I used to do when I was young was to listen to a tune I knew on the radio or CD. Once I was into the groove of the tune I would turn the sound down for a period of time (30 sec maybe?) keeping time in my head. I would then turn the sound back up and see how close I was to being in the right place in the tune.
I found that generally if I concentrated I would be pretty accurate. Then I think it's a matter of getting that level of concentration to be automatic.