Arguably, doing a PHD is supposed to be exactly the preparation you speak of. It is the first time in your education when you are most certainly expected to transform from the mere consumption of Mathematics to also producing new results; the general idea, however, is not that you simply start doing so, but rather that you have an advisor who guides this process. I mention this because you'll do well to remember that your advisor has this responsibility towards you, as you have the responsibility to invest time and effort to make the transformation, which is not an easy one for most people.
That said, here is my list of tips:
- You may find yourself under a lot of stress to produce results. Unless (maybe even if!) you are an absolute one in a billion genius, the results may take quite a while to come, months, maybe years. Prepare yourself mentally for this fact. Although, I am afraid, I was told the same thing in advance, took it serious, and I still was absolutely unprepared for the reality of it.
- "Having a new idea" is what you rarely learn in undergrad courses, where most people puzzle together theorem statements from the lecture to prove exercise results. This is not a bad thing, you will need this skill to make your ideas work, and you will also need this skill to get into new fields where new ideas are needed. However, having an idea is different and how exactly you come to have ideas, noone can tell you. I have known many different mathematicians and their minds all work in different ways. However, there is one thing they all have in common: They have their best ideas when they are relaxed and at ease. Find ways and time to be relaxed and ponder about Mathematics without feeling stressed out. How exactly you do that will be up to you.
- Work with other people whenever you can. Collaboration is extremely powerful both to keep you engaged with a problem and to overcome obstacles.
- Be enthusiastic or have the ability to get enthusiastic about your research topic. Without that, you are unlikely to muster the mental endurance required to actually do research in it.
- At the beginning of your PHD, you must listen very carefully to your advisor. Towards the end of it, you must make sure that your advisor is listening very carefully to you.
- Make concrete examples. I explained this at length in a Math.SE answer. This should work even in very pure fields, even though "concrete" may mean something else for you than for others. The important part will be that it is concrete for you, i.e. that it enriches your intuition.
- Find a good balance between intuition and rigor. Relying too heavily on either will get you stuck. I believe that the more experience you have, the more you can rely on your intuition; but for someone starting out in Mathematics, I believe it is healthy to go with a 50/50 approach here.
While it is not my tip, I would like to include this excellent suggestion from the comments:
Keep a notebook of ideas that might result in fruitful explorations. Review it periodically. These are the ideas that you don't have time to develop now, but might lead to something when current projects come to fruition.