Rap constantly. GZA said that "Wu-Tang" stood for "Witty Unpredictable Talent and Natural Game," which is as good a description of any as what it is we're looking for in good rap music. To make it second-nature, you've got to rap all the time. Listen to rap as much as you can, analyze it, and draw inspiration from everything. Successful rapping takes hours and hours of practice, so you should do whatever you can whenever you can.
Make a rap journal. Keep track of your raps, and practice them out of the journal. Carry it everywhere so that when inspiration strikes, you have a place to write your thoughts down.