The maximum XP per game is 30,000 plus an additional 75% of the in-game XP (max 22,500) in addition to the end game award bonus.  Experience (XP) is passively generated at a rate of 2 XP per second and can be generated directly by: Resources gathered per sec for calculating villager second costs Dancers Gift Dance (XP/Sec) Map Trade Travois Stagecoach Iron Horse
Resource Resource Type Base Rate / Sec + % Rate Rate / Sec[1] 0 0.0 Rockies 1.0816 1.8929 2.3043
1 0.5 Patagonia 1.1458 1.9643 2.3913
1 Constructing buildings provides:  20% XP if economic, 10% XP if military, and 14% XP if outposts (from total cost) Coin Gather Rate Mining 0.60 0% 0.60 2 1.0 Patagonia 1.1778 1.9630 2.4091
2 Creating units:  All units, including villagers, give 10% XP of their total cost Food Gather Rate Berries / Cherries 0.67 0% 0.67 3 1.5 Texas 1.2090 2.0250 2.4545
3 Dancing at the fire pit:  Gift Dance generates ~0.5 XP per second per villager (up to 25 villagers, 35 with Aztec)   Wood Gather Rate Tree 0.50 0% 0.50 4 2.0 Great Lakes 1.2020 2.0333 2.4646
4 Destroying buildings:  Worth double the build XP 5 2.5 Unknown 1.2735 2.1439 2.5913
5 Killing enemy units:  Grants the same amount of XP as building them.  The Aztec WC aura triples this value.  Japan's Torii Gates Wonder boosts XP from kills and constructing buildings +50%.  [2]     6 3.0 Average 1.182 2.004 2.436
Resource Type Compared: Dance XP / Sec[3] 5 7 3.5
6 Livestock (India):  Collection of livestock with or without the Sacred Field generates approximatly 5XP every 50 seconds (0.1 XP / sec) without the field and 25XP every 83 seconds (0.3 XP / sec) on the Sacred Field. 
See the worksheet "Resource Rate - Sacred Field" for more information.
Resources or XP Gathered:[4] 200 XP / (Sec*Villager)[5] 0.50 8 4.0 NOTE:  These values were obtained by watching as a trade travois (or stagecoach or iron horse) passed a TP and recorded the time.  Then waiting until the trade travois passed the same TP and recording the total time to bring in resources.  The resources were then divided by the total time the trade travois took to complete the trade route.  This was repeated numerous times to nail down the total trade route time (time to reach beginning to end).  Notice there are slight differences on the same map (different curves and lengths) and differences between different maps (different trade route).  For this reason, an average value of all maps was used.  
Villagers Dancing:[6] 10 Resource Crate / TP Bonus[7] 0% 9 4.5
Include [8] TEAM Ottoman Silk Road No 10 5.0
7 Mosques (Ottoman):  Auto-gather XP at 0.4 XP per second (while standing) 11 5.5
8 Shines (Japan) can be configured to generate XP once the Age 2 Shipment "Seven Lucky Gods" is sent.  The XP generated is dependent on the number shrines, animals captured, if a Toshogu Shrine Wonder was constructed, etc.  See the worksheet "Resource Rate - Shrine" for more information. 12 6.0
Trading Post Upgrade Gathering Rate (Res / Sec)[9] Age Available Cost to Upgrade VS for Upgrade[10] Time for Upgrade to pay for itself on 1 TP (sec)[11] VS to gather[12] Time for TP to gather (sec)[13] Equivalent Villagers[14] 13 6.5
Coin Food Wood 14 7.0
9 Trading Posts:  Gather XP (or resources) at approximately 1.18, 2.00, and 2.44 per second for the trade travois, stagecoach, and iron horse respectively.  Trading posts appear to give different amounts of XP or resources on different maps (and even on the same map it may spawn differently).  However, this effect is due to the length and curves in the trade route (i.e. the longer the trade route, the more XP or resources obtained each time the travois passes, yet it takes longer to pass).[15] Trade Travois[16] 1.2 1 0 0 0 0 0 ---- 169 2.4 15 8.0
Stagecoach 2.0 2 0 200 200 699 200[17] ---- 100 4.0 16 8.5
Iron Horse 2.4 4 400 0 300 1,267 287 ---- 82 4.9 17 9.0
18 10.0
10 End-game award bonus:  500 XP is awarded for the Most Resources, Least Resources, Most Improvements (shipped in technologies such as Heavy Fortifications does not count to total), Most Military Units, Most Units Killed (treasure guardians count), Most Units Lost, Highest Score, Most Treasures.  In addition, 2,000 XP is awarded to the winner (victory experience).   19 10.5
Miscellaneous Trading Post Calculator Notes: 20 11.0
  1 The yellow highlighted cells in the "Resource Type:" column represent the coin, food, and wood gathering rates.  Select the desired resource to be compared (drop down menu) with the trading post (i.e. mining is faster than plantation, hunting faster than berries, etc.)  The slower the resource collection rate compared, the trading post will appear more useful.   21 11.5
Basically, XP is awarded for spending resources or destroying others property.  The XP generated for creation / kill can be observed by hovering over the small unit icon in game.  Contrary to popular belief, XP is not generated for: 22 12.0
23 13.0
24 14.0
1 Exploring the map 2 The yellow highlighted cells in the "+ % Rate" column represent resource upgrade technologies.  For example, if it is desired to compare wood chopping with the first European market upgrade "Gang Saw", type 10 into this cell (10% upgrade).  The "Rate / Sec" column will automatically adjust. 25 14.5
2 Gathering resources:  The exception is the end-game award XP for the player with the most resources gathered. 26 15.0
3 Units from shipments:  The exception is that units shipped count towards the total unit count and the player with the most units gains 500 end-game award XP. 27 16.0
28 17.0
4 Researching Technologies:  The exception is the end-game award XP for the player with the most technologies researched. 3 The "Resource Type Compared:" yellow highlighted cell has a drop down menu that allows the  trading post to be compared with coin, food, wood, or dancing at the fire pit.  Each of these resources is collected at a different rate (i.e. "Resource Type" and "+ % Rate" columns) and will affect the trading post equivalent villagers.   29 17.5
30 18.0
In the table below, XP required for the next shipment is approximately 15% more than the previous.  Spain receives shipments ~ 25% faster, Germany receives shipments ~ 10% slower, and India receives shipments ~ 8% slower on average than standard civilizations.  The table below represents approximate XP required for shipments 1 to 20 and includes all civilizations except those listed.    31 19.0 Comparisons Trade Travois / Stagecoach Trade Travois / Iron Horse
32 20.0
4 The "Resources or XP Gathered:" yellow input cell can be changed to any amount of resources (i.e. 100, 250, 500, etc.) if the "Resource Type Compared:" cell is set to "Coin", "Food", or "Wood" or XP if the "Resource Type Compared:" cell is set to "Dance". 33 21.0 Resource Ratio 0.590 0.485
34 22.0 Speed Ratio 0.571 0.471
Shipment XP Req.[18] Cumulative China / Japan XP Req. China / Japan Cumulative German XP Req. German Cumulative India XP Req. India Cumulative Spain XP Req.[19] Spain Cumulative 35 23.0
Notice how close the ratios of resource gathering rate to the speed of the unit is.  
5 The "Villagers Dancing:" yellow input cell can be changed to a 1 to 35 villager dancing rate if the "Resource Type Compared:" cell is set to "Dance".  The Gift Dance is approximately 0.5 XP per second per villager but is not linear.  The more villagers dancing, the more XP is earned per villager.  Different rates (various amounts of villagers) can be compared with the trading post building.  The more villagers dancing, the lower the effects of the trading post.  
Shipment 1 300 300 300 300 330 330 324 324 225 225
Shipment 2 345 645 345 646 380 710 373 697 259 484
Shipment 3 397 1,042 397 1,043 436 1,146 428 1,125 298 781 Fishing - Whaling (canoes, etc.) Berries / Cherries Tree Coin
Shipment 4 456 1,498 457 1,500 502 1,648 493 1,618 342 1,124 Fishing - Whaling (fishing boat, warship) Farm Mango Grove Food
Shipment 5 525 2,023 525 2,025 577 2,225 567 2,185 394 1,517 6 The Ottoman specific Age 2 HC team shipment "Silk Road" can be compared by selecting "TEAM Ottoman Silk Road" and "Yes" in the yellow drop down menus.  This grants a 30% bonus to all trading post resource rates (excluding XP).  The Japan specific Age 2 Consulate Spanish shipment "Nanban Trade" can be compared by selecting "Japan Spanish Consulate Nanban Trade" and "Yes" in the yellow drop down menus.  This grants a 25% bonus to all trading post resource rates (excluding XP).   Mining Fishing (canoes, etc.) Wood
Shipment 6 603 2,626 604 2,629 664 2,889 652 2,836 453 1,970 Mining - Dutch Fishing (fishing boat, warship) Yes Dance
Shipment 7 694 3,320 695 3,324 763 3,652 749 3,586 520 2,490 Plantation Hunting No
Shipment 8 798 4,118 799 4,123 878 4,530 862 4,447 599 3,089 Rice Paddy Mill
Shipment 9 918 5,036 919 5,042 1,009 5,539 991 5,439 688 3,777 TEAM Ottoman Silk Road Rice Paddy
Shipment 10 1,055 6,091 1,057 6,099 1,161 6,700 1,140 6,578 792 4,568 Japan Spanish Consulate Nanban Trade
Shipment 11 1,214 7,305 1,215 7,314 1,335 8,035 1,311 7,889 910 5,479 7 The grouping buttons located at the top of the spreadsheet can be selected to view additional information such as the "Time for Upgrade to pay for itself on 1 TP (sec)", a fire pit dance table, the base trade route gathering rates, and other miscellaneous calculations.  
Shipment 12 1,396 8,701 1,397 8,711 1,535 9,571 1,507 9,397 1,047 6,525
Shipment 13 1,605 10,306 1,607 10,318 1,766 11,336 1,733 11,130 1,204 7,729
Shipment 14 1,846 12,151 1,848 12,166 2,030 13,367 1,994 13,124 1,384 9,114
Shipment 15 2,123 14,274 2,125 14,292 2,335 15,702 2,293 15,416 1,592 10,706
Shipment 16 2,441 16,715 2,444 16,736 2,685 18,387 2,636 18,052 1,831 12,536
Shipment 17 2,807 19,523 2,811 19,547 3,088 21,475 3,032 21,084 2,105 14,642
Shipment 18 3,228 22,751 3,232 22,779 3,551 25,026 3,487 24,571 2,421 17,063
Shipment 19 3,713 26,464 3,717 26,496 4,084 29,110 4,010 28,581 2,784 19,848
Shipment 20 4,270 30,733 4,275 30,771 4,696 33,806 4,611 33,192 3,202 23,050
Miscellaneous Notes:
1 Early in the game, the XP trickle is the main XP source.  In order to get shipments faster, construct buildings immediately.  For example, a house at 20XP will send a shipment 10 seconds faster (2XP awarded per second passively).
2 To level the Home City faster, research Mercantilism in each game for a quick 2,000XP towards the 30K XP maximum.
3 Since the passive XP rate is 120 per minute, economic buildings give 20%, military buildings give 10%, outposts give 14%, and all units, including villagers, give 10% of their cost, a FF strategy can be developed.  
4 Build 2 houses or 1 house + 1 market (40 XP) and 2 villagers (20 XP), 60XP is awarded. 
The Spanish require 484XP for two shipments, so (484 - 60) / 120 = 3.53 minutes = 3:32 for second shipment. 
All other civilizations (except Germany & India) require 645XP for second shipment, so (645 - 60) / 120 = 4.88 = 4:53 for second shipment.  
5 60XP is awarded passively during the 30 second time (0:30) spent on a fast age-up to all ages except Fortress. 
80XP is awarded passively during the 40 second time (0:40) spent on a fast age-up to Fortress. 
180XP is awarded passively during the 90 second time (1:30) spent aging up to all ages except Fortress. 
220XP is awarded passively during the 110 second time (1:50) spent aging up to Fortress.  
6 The 4 wagon outpost Home City shipment will give 140XP (4 x 35XP each) after setting up the buildings.  Considering the 40 seconds (80XP) for them to be shipped to the New World and 25 seconds to be constructed (50XP), that is a large portion of the next Fortress Age shipment (270XP).  Not to mention it is worth 1,000 in wood resources (the slowest gathering resource).  
7 Experience was tested by allowing the villagers to sit in the TC in a sandbox game without collecting any treasure.  The experience trickle of 2XP per second was measured and compared in the table above.  
8 The time to upgrade to "Stagecoach" or "Iron Horse" is 1 minute.  
This worksheet was inspired by the thread "XP and Trading Posts", originally written by "Flammifer" from Age of Empires III Heaven Games.  

[1]
NOTE:
The rate of resource collection per second with any technology upgrades included (i.e. market)
[2]
NOTE:
The Founder Big Button technology at the Fire Pit is currently bugged and has no effect.
[3]
NOTE:
The amount of experience earned per second with the amount of "Villagers Dancing" in the yellow highlighted cell. 
[4]
NOTE:
Type in the amount of resources or XP desired to be gathered to determine the "Time for TP to gather (sec)" column below. 
[5]
NOTE:
The equivalent amount of experience earned per second per villager dancing. 
[6]
NOTE:
This determines the XP trickle rate of a simulated fire pit.  The more dancers, the higher the XP awarded per villager (not perfectly linear). 

In order to compare the fire pit to the trading post, an XP gathering rate per villager must be calculated.