Indy has good advice...

Another thing you might try on the trainer is to work on how your body feels when you're using your core to support yourself. Put your bike on the trainer, put your hands on the bars where you usually ride (hoods?), then take all your weight off your hands. Now you can move your hands from the hoods to the tops, or take them off the bars, but your torso isn't moving. Next, do the same thing with your hands on the drops near the shifters. Finally, practice taking each hand from the hood to the shifter and back, still keeping your weight off your hands and trying to keep your shoulders level.

That's not the best way to build core strength, but a lot of balancing is just learning to trust the way your body feels. (I just experienced this within the past month, learning to get into a handstand against the wall. First it was impossible, then when my yoga teacher helped me it was terrifying, but once I understood how it felt when I was high enough for my legs to get light, I just went up. )