I don't think IMF can take any legal action against a country's decision on sovereignty. However, IMF holds a severe lending power which they can made unavailable for El-Salvador. And if IMF denies to lend them money for their needs, I am sure world bank will follow the same path even though these two organizations are different.
It's great to see how a small nation is holding onto their decision and not bending down in front of international pressure i just hope bitcoin serves their economy well.