Do I determine the cost of the spell before or after I generate the mana?
Either! You can generate mana at any time during your main step, before starting to cast a spell. However, you can also generate it during the spell-casting process:
601.2e The player determines the total cost of the spell. Usually this is just the mana cost. Some spells have additional or alternative costs. Some effects may increase or reduce the cost to pay, or may provide other alternative costs. Costs may include paying mana, tapping permanents, sacrificing permanents, discarding cards, and so on. The total cost is the mana cost or alternative cost (as determined in rule 601.2b), plus all additional costs and cost increases, and minus all cost reductions. If the mana component of the total cost is reduced to nothing by cost reduction effects, it is considered to be {0}. It can't be reduced to less than {0}. Once the total cost is determined, any effects that directly affect the total cost are applied. Then the resulting total cost becomes "locked in." If effects would change the total cost after this time, they have no effect.
601.2f If the total cost includes a mana payment, the player then has a chance to activate mana abilities (see rule 605, "Mana Abilities"). Mana abilities must be activated before costs are paid.
So in this case, you could determine the total cost (which would include 1 generic mana), then activate Generator Servant in order to produce mana, thus spending 1 of those 2 mana on the Nemesis of Mortals
And to show that Generator Servant's ability is indeed a mana ability:
406.1. A mana ability is either (a) an activated ability without a target that could put mana into a player’s mana pool when it resolves or (b) a triggered ability without a target that triggers from a mana ability and could produce additional mana. A mana ability can generate other effects at the same time it produces mana.