Here are just some examples of times you might want to trade.
- Trade when you need to.
This one is simple. If you're under attack and you need a military tech, quickly - or if you need any tech in a hurry, come to that - then don't worry about trading for it. As long as you're getting a big advantage out of the trade, it doesn't matter (much) whether the AI is benefitting from it.
- Trade with the slowest AI.
Now, sometimes you'll have to trade with the 'best' AI, because they're the only ones with useful techs. But often, near the beginning of a game, you'll find that there's only one guy left who doesn't know Monotheism or Sailing. In that case, you may as well trade it to him... after all, if you don't, then someone else will.
- Trade when your monopoly is broken.
Say you were the first to research Philosophy, and you want to keep it to yourself. However, ten turns later, your biggest rival researches it himself. Trade it away now! After all, one of you is going to give it to all of the other AIs. Whoever does that will get a big advantage. It might as well be you.
- Trade to more than one person at the same time.
Let's say it's near the beginning of the game, and you've researched Alphabet. If you're lucky, you're the only one who knows it. If you're even luckier, you're the only one who knows Writing. In that case... trade Writing with one guy for Sailing. Trade Writing with someone else for Pottery. Trade writing for Priesthood so you can start building the Oracle. If you're lucky, you can trade Writing for half a dozen different techs... each AI benefits a little, but you benefit a lot.
Now, here's the most important one:
- Trade for a reason.
This one's really hard to do - certainly, I don't manage this most of the time. However, it's one of the things that separates the good players from the great players. Every time you have the opportunity to trade, ask yourself what you'd get from trading, and what you'd get from not trading. Then pick between the two.
You'll have to weigh up for yourself whether ten turns' headstart on that wonder is worth missing out on the benefits of trade. You'll have to decide for yourself whether you can risk giving Gunpowder to a warmonger (perhaps if you bribe him to fight someone else, it's actually a good idea...). All such decisions will be easier if you've thought through the consequences beforehand. You should always know:
- What will I be able to do with my new techs?
- What will the AI do with the techs I'm giving them?
Finally, remember that you don't always have to trade techs for more techs. You could sell them for gold (allowing you to upgrade units or run a higher research %), you could sell them for better AI relations (possibly leading to a diplomatic victory), or you could use them to bribe an AI into war (slowing their science and keeping their armies busy). Be creative.