formerly ~ formally:
[‘formerly’ rhymes with ‘formally’]

(sages formerly lived this way)
“Formerly” (for the right pronunciation, please click here) is the adverb form of ‘former’ and it means ‘previously or in earlier times’,
e.g.
This piece of land was formerly owned by a landlord, but now it belongs to the peasants who work on it.
______________________________

official (R) formaly sworn-in
“Formally” (for the right pronunciation, please click here) is the adverb form of ‘formal’ and it means ‘something done in an official or socially acceptable manner’,
e.g.
My superior officer formally accepted my resignation, but advised me informally not to do so. [i.e. he accepted my resignation as per the rules and norms of the office – officially, but he advised me not do so as a colleague and friend – unofficially]
My hostess formally introduced me to her other guests at the party.
