Depending on where you live, your mimosa tree may be suffering from wilt, which has spread through the Southern states. Try a 10-10-10 balanced fertilizer to help.
Mimosa wilt is a fungal disease that eventually will kill the tree. If caught in early stages, you can fertilize the tree with 10-10-10 fertilizer. This will slow the disease.
If the foliage is not affected it is probably wetwood, which is not fatal. If the foliage is dying it is probably mimosa wilt, andthe tree will very likely die.
When a mimosa tree is foaming it usually means it is dying. It is very difficult to help these trees. I would suggest fertilizing with an anit-fungal fertilizer. This may help depending on how bad the tree is. You can buy this fertilizer at any nursery and some hardware stores.
In my opinion, foaming is a natural process that is typical of mimosa trees. My mother had a mimosa tree that foamed, and it turned out to be beautiful.