Riding on a bike is simply spinning your legs in tiny circles. Your legs don't actually care what your eyes see or where your body goes when they are spinning in tiny circles. The more you spin in tiny circles, the more your leg muscles will adapt to the motion. Sometimes you add resistance, making it harder for your legs to spin in tiny circles, thus increasing leg power and adaptation to the resistance. What makes riding on the trainer more clear is some sort of device that will quantify your effort. Power meters help. If you have a trainer with fixed resistance, speed will also help. Heart rate may or may not be of value, depending on who's philosophy you believe. Trainers reduce the variability that can come from external sources (such as wind, temperature, and obstacles along the way) making one workout to the next a more accurate comparison (assuming you're the type of bloke that likes to compare such things).
As far as duration and frequency, it really depends on what your IM goals are and what your base/ strengths are in IM endurance. The higher the goals or the weaker the base, the more saddle time you need (assuming you've done this sort of thinking in the other disciplines and are capable of calculating a balance). Tough to answer without any specific information about your training levels and goals.
Take a short break from ST and read my blog:
http://tri-banter.blogspot.com/