The difference in meaning between formerly known and formally known is quite clear. But because they sound the same, they sometimes get confused, with messy results.
Formal picture from Shutterstock
For instance, here's a quote from an ABC news story about diesel fuel rebates:
Government sources have confirmed the budget razor gang has examined the diesel fuel rebate, now formerly known as the fuel tax credit.
The presence of "now" makes it clear that was actually meant was "formally known as". Given that the story is a transcript of a radio broadcast, it's easy to see how the error arose.
It's also not hard to find examples where confusion happens in the other direction, with formally known being incorrectly used to mean "this is what the name used to be". In the spoken word, you'd never know, but written down it's a mistake.
While this isn't a particularly difficult distinction to master, I'd suggest one way of minimising the risk of the error is to choose a different expression when you do need to write "formally known". Taking the ABC example, you could write this as:
Government sources have confirmed the budget razor gang has examined the diesel fuel rebate, or the fuel tax credit as it is officially known.
Government sources have confirmed the budget razor gang has examined the diesel fuel rebate, more properly referred to as the fuel tax credit.
If you really want to avoid confusion, you might also choose "previously known" when you need to say "formerly known". But since no-one wants to use the expression "the artist previously known as Prince", making "formally known" the phrase you try to avoid is probably a better choice.
If you're not 100 per cent sure of the distinction — or if you aren't sure your audience will be — then skipping both phrases makes sense. Accuracy matters, and so does avoiding any potential source of confusion for readers or listeners.
Lifehacker's Mind Your Language column offers bossy advice on improving your writing.