The question of when to get wheelbarrow and hand cart is a very old one. The general wisdom is that wheelbarrow should be researched around 15-18 minutes in, and hand cart whenever you can afford it. Although the economic impact is the main one considered, the increased villager speed is also useful. How can we make this advice more specific? The method I will use will be to quantify the economic effect of these upgrades and then relate them to the cost of the upgrades. In the end, I find that wheelbarrow is worth researching after 32 villagers for food-heavy builds and 36 for less food-dependent builds. For hand cart, the research is justified after 64 villagers for knight builds and 72 villagers for crossbowman builds. These numbers can be shifted down somewhat (for example, to help villagers evade knight and scout raids), but too much lower will affect military (and booming) capacities.
We first consider the economic impact of wheelbarrow. The farm gather rate without wheelbarrow is 0.32 food per second (that takes into account path length). With wheelbarrow, it's 0.36. That means for every eight farmers you have, you basically have a ninth working on a ghost farm. However, the great thing about ghost farms is you don't have to replenish them, because they don't exist (although you do have to replace your existing ones slightly more often). Either way, for every "extra" farm villager you have as a result of wheelbarrow, that's a short term saving of 60 wood that would other wise be invested in a farm. Meanwhile, wheelbarrow has a smaller effect on wood cutters and miners. It's a basic fact of Age of Empires that there will be some transit time, but on average, over time, each villager will walk two tiles to their place of work (this is because of recession of the wood line and depletion of mineral reserves). Using this information, we can calculate that for every sixteen wood cutters/miners, you will gain one more.
Now in order to research wheelbarrow, we must allow our town centre to be idle for 75 seconds, which is the time it takes to recruit three villagers. However, three villagers costs 150 food, compared to 175 food and 50 wood for wheelbarrow, so that leaves a net cost of 25 food and 50 wood. If we want our economy to be as strong before as after, we insist that the economic impact of wheelbarrow equals three villagers. The reality is that this varies with builds, but in the previous paragraph, we found the information to answer this question. Here is a simple rule of thumb: take the number of wood cutters and miners, and add it to twice the number of farmers (because farmers gain twice the marginal efficiency), and if it adds up to 48, it's time to research wheelbarrow. For a food-heavy build such as scouts, you're likely to have around 16 farmers and 16 wood cutters and miners (give or take) about 15 minutes in, and that's when wheelbarrow strengthens your economy by three villagers. For less food-dependent builds such as archers, you may have 12 farmers and 24 wood cutters/miners at around 17 minutes. Once again, wheelbarrow in this context is worth three extra villagers. This is consistent with the popular wisdom.
However, there are two things I haven't taken into account. First, there is a bit of time while researching wheelbarrow where there is one, then two villagers less than a player researching wheelbarrow. However, this is small, and easily offset by delaying wheelbarrow by one villager, if you wish. The second thing is the fact the "extra" farm villager doesn't require 60 wood to sow their farm. This means a short term saving of 120 wood on food-heavy builds, and 90 wood on less food-dependent builds (if you can visualise a farm-and-a-half). This more than covers the net cost of 25 food and 50 wood from the previous paragraph. It also covers the small cost of having one, then two villagers less while researching wheelbarrow. If anything, this means you can research wheelbarrow a villager or two earlier.
As we move on to hand cart, we notice that it costs a lot more (300 food and 200 wood) and takes less time to research (55 seconds, or 2.2 villagers). This has a very similar effect on a villager's relative efficiency, and breaks even before wheelbarrow, and has a net cost of 190 food and 110-140 wood (because 2.2 villagers are worth 110 food and one to and-and-a-half farmers). However, there is a substantial deficit which will now take a while to recover, and in that time, you could lose the game to a superior military. A better question would be: when is my economy worth an extra 300 food and 200 wood invested in villagers? Suppose I have a food-heavy economy, for example, for knights. If I have 32 farmers and 32 wood cutters/miners (once again, feel free to vary the numbers slightly), then I have four "extra" farmers, two "extra" wood cutters/miners. This is worth 300 food invested in villagers and 240 invested in farm. On the other hand, if my economy is less food-dependent, such one set up for crossbowmen, I might have 24 farmers and 48 wood cutters/miners, which is worth 300 food and 180 wood. Another rule of thumb can be derived from this. Whatever your economy, if you take your number of wood cutters and miners, add it to twice the number of farmers, and it adds up to 96 (six extra villagers), it's time to get hand cart.
A few miscellaneous considerations; as a general rule, it's not a good idea to get these upgrades early, with one exception. On a sheerly economic level, if you research wheelbarrow as soon as you hit the feudal age, your economy will only be slightly stronger, and it will take the sting out of your rush. 15-18 minutes is when the boost has a visible impact. Correspondingly, if you research hand cart as soon as you reach the castle age (unless you've had a very long feudal war), your economy will be a bit stronger, but any early castle age aggression you intend will lose its bite. On the other hand, if you decide to go up to three town centre villager production, the bonus gained from hand cart won't match that of constant villager production. A player who delays it until they have a large enough economy to notice the effect will reap almost all of the benefits, but without the short term loss of power. The exception to the rule of early wheelbarrow and hand cart is when you want it for faster villagers. If you have a badly exposed but vital wood line or you want to chase down enemy villagers during a forward, early wheelbarrow has a definite strategic advantage. There, you can justify reducing the numbers in the rules of thumb to 32 and 64, but it is a discretionary tool. No matter how much you want to protect your villagers, it shouldn't come at a time when your military can't afford the diversion of resources. However, the bottom line is that the economic efficiency method gives us a baseline estimate that can be borne in mind in-game. Even if there is no perfect time to research either technology, we can still develop an idea of when its effects will become noticeable enough to justify researching it.
We first consider the economic impact of wheelbarrow. The farm gather rate without wheelbarrow is 0.32 food per second (that takes into account path length). With wheelbarrow, it's 0.36. That means for every eight farmers you have, you basically have a ninth working on a ghost farm. However, the great thing about ghost farms is you don't have to replenish them, because they don't exist (although you do have to replace your existing ones slightly more often). Either way, for every "extra" farm villager you have as a result of wheelbarrow, that's a short term saving of 60 wood that would other wise be invested in a farm. Meanwhile, wheelbarrow has a smaller effect on wood cutters and miners. It's a basic fact of Age of Empires that there will be some transit time, but on average, over time, each villager will walk two tiles to their place of work (this is because of recession of the wood line and depletion of mineral reserves). Using this information, we can calculate that for every sixteen wood cutters/miners, you will gain one more.
Now in order to research wheelbarrow, we must allow our town centre to be idle for 75 seconds, which is the time it takes to recruit three villagers. However, three villagers costs 150 food, compared to 175 food and 50 wood for wheelbarrow, so that leaves a net cost of 25 food and 50 wood. If we want our economy to be as strong before as after, we insist that the economic impact of wheelbarrow equals three villagers. The reality is that this varies with builds, but in the previous paragraph, we found the information to answer this question. Here is a simple rule of thumb: take the number of wood cutters and miners, and add it to twice the number of farmers (because farmers gain twice the marginal efficiency), and if it adds up to 48, it's time to research wheelbarrow. For a food-heavy build such as scouts, you're likely to have around 16 farmers and 16 wood cutters and miners (give or take) about 15 minutes in, and that's when wheelbarrow strengthens your economy by three villagers. For less food-dependent builds such as archers, you may have 12 farmers and 24 wood cutters/miners at around 17 minutes. Once again, wheelbarrow in this context is worth three extra villagers. This is consistent with the popular wisdom.
However, there are two things I haven't taken into account. First, there is a bit of time while researching wheelbarrow where there is one, then two villagers less than a player researching wheelbarrow. However, this is small, and easily offset by delaying wheelbarrow by one villager, if you wish. The second thing is the fact the "extra" farm villager doesn't require 60 wood to sow their farm. This means a short term saving of 120 wood on food-heavy builds, and 90 wood on less food-dependent builds (if you can visualise a farm-and-a-half). This more than covers the net cost of 25 food and 50 wood from the previous paragraph. It also covers the small cost of having one, then two villagers less while researching wheelbarrow. If anything, this means you can research wheelbarrow a villager or two earlier.
As we move on to hand cart, we notice that it costs a lot more (300 food and 200 wood) and takes less time to research (55 seconds, or 2.2 villagers). This has a very similar effect on a villager's relative efficiency, and breaks even before wheelbarrow, and has a net cost of 190 food and 110-140 wood (because 2.2 villagers are worth 110 food and one to and-and-a-half farmers). However, there is a substantial deficit which will now take a while to recover, and in that time, you could lose the game to a superior military. A better question would be: when is my economy worth an extra 300 food and 200 wood invested in villagers? Suppose I have a food-heavy economy, for example, for knights. If I have 32 farmers and 32 wood cutters/miners (once again, feel free to vary the numbers slightly), then I have four "extra" farmers, two "extra" wood cutters/miners. This is worth 300 food invested in villagers and 240 invested in farm. On the other hand, if my economy is less food-dependent, such one set up for crossbowmen, I might have 24 farmers and 48 wood cutters/miners, which is worth 300 food and 180 wood. Another rule of thumb can be derived from this. Whatever your economy, if you take your number of wood cutters and miners, add it to twice the number of farmers, and it adds up to 96 (six extra villagers), it's time to get hand cart.
A few miscellaneous considerations; as a general rule, it's not a good idea to get these upgrades early, with one exception. On a sheerly economic level, if you research wheelbarrow as soon as you hit the feudal age, your economy will only be slightly stronger, and it will take the sting out of your rush. 15-18 minutes is when the boost has a visible impact. Correspondingly, if you research hand cart as soon as you reach the castle age (unless you've had a very long feudal war), your economy will be a bit stronger, but any early castle age aggression you intend will lose its bite. On the other hand, if you decide to go up to three town centre villager production, the bonus gained from hand cart won't match that of constant villager production. A player who delays it until they have a large enough economy to notice the effect will reap almost all of the benefits, but without the short term loss of power. The exception to the rule of early wheelbarrow and hand cart is when you want it for faster villagers. If you have a badly exposed but vital wood line or you want to chase down enemy villagers during a forward, early wheelbarrow has a definite strategic advantage. There, you can justify reducing the numbers in the rules of thumb to 32 and 64, but it is a discretionary tool. No matter how much you want to protect your villagers, it shouldn't come at a time when your military can't afford the diversion of resources. However, the bottom line is that the economic efficiency method gives us a baseline estimate that can be borne in mind in-game. Even if there is no perfect time to research either technology, we can still develop an idea of when its effects will become noticeable enough to justify researching it.