Legality of downloading books from websites such as Library Genesis
The legality of possession of pirated content varies across countries. In many countries, it is perfectly legal to have copies of copyrighted content as long as you don't share it with others. In the US, downloading such content is illegal, but you are unlikely to get into trouble by having illegally copied content on your hard drive. I found a great answer on Quora by an attorney, parts of which I'm going to quote:


  Yes, it is illegal to download ("make copies") of material that is protected by copyright.  However, all that is illegal is not criminal.  Copyright for the most part is a civil statute, with civil remedies (i.e. the copyright holder sues you for money).
  
  Criminal copyright infringement is much more limited than civil copyright infringement.  The criminal portion of the Copyright Act (17 USC § 506) states that it is a criminal act to willfully infringe copyright 1) for the purposes of commercial advantage or private gain; 2) by reproducing or distributing within 180 days one or more copies of works with a retail value of more than $1,000; or 3) by distributing a work being prepared for commercial distribution (i.e. a work that has not yet been released for sale to the public by a copyright holder, but that will be made available or a movie that is currently playing in a theater).


It would be very difficult to classify what you describe as criminal. As long as you only download (and not share) publications for your private use, you are unlikely to have issues.


  For the average person, generally there won't be any criminal consequences under copyright law from having pirated items on your computer.  That isn't to say that a creative prosecutor couldn't make a case (particularly if you have file sharing software installed, in which case you could possibly be looking at a violation of the second prong of the statute).  But in the real world, this is not the type of crime that most police go snooping for when they decide to rummage through your laptop.


There are some cases where students are getting into trouble by using school equipment or connection to pirate content (mostly audio and video), so it is probably a good idea to keep this business on your private computer. You can further decrease the chances of any legal trouble by using TOR, VPN and keeping the pirated content in an encrypted container with a strong password.

tl;dr: It's illegal. As long as you don't get caught downloading the files, you are unlikely to get in trouble. It's more about your own views on the ethics of scientific publishing and copyright.