No, Libgen is not legal, and using Libgen may open you up to legal ramifications.