With regard to finding the parts in italics, that is the question for most of us. There have been several useful posts that lists discovered events and functions, but the list is far from complete. So far the methods used by most to locate what they need is to either search those lists or to search through existing lua code from the game trying to find keywords that match generally what they are doing. If we are really lucky, Firaxis will release a full Lua API document, but we are probably on our own for a while.
With regard to your specific question, you would want to use Event.SerialEventEraChanged.Add( GivePolicy )
Your GivePolicy function would have a function signature of function GivePolicy( era, player )
era would be the numeric value of which era was just changed to, and player is the player id.
I found the event by searching all lua files in the game directory for 'Era' and found the SetCityEra section in DebugMode.lua. It seems to do what you want, but I haven't tested it. If you only want it to work for a specific player, you'll need to test for that in your code.
However, the closest function for actually giving them a policy is the following:
Code:
Network.SendUpdatePolicies(m_gPolicyID, m_gAdoptingPolicy, true);
But that only seems to function directly on the active player (which is actually what 'player' would be from the Event triggering GivePolicy. m_gPolicyID is the numeric index of the policy to be adopted, m_gAdoptingPolicy is a boolean that I think determines if the policy is actually adopted or not.
Sadly, you'll need to experiment a bit with this, but hopefully someone else has been digging around in how the policy system works.
I found the function by searching all lua files in the game directory for 'Policy' and found the code in SocialPolicyPanel.lua.