There is one piece of evidence most miss when this topic comes up; granted it is VERY easy to miss. In "Scorpion, pt. I." When Janeway looks at her monitor concerning the Hansens and Starfleet's knowledge of the Borg, the classified database file begins on Stardate 9521.6. Since Stardates from the movies on are pretty much chronologically fixed, this would place the database in the same year as "Generations" (which is Stardate 9715.5). As others have said above, Starfleet knew of the El-Aurians before "Generations", thus some knowledge of the Borg must have leaked. One would assume that since they were so very far away in the Delta Quadrant and because nothing was heard of them, the file got buried and forgotten after nearly a century or deemed a non-imminent threat by Starfleet Security.
However, and this is the part that is hard to swallow, the Federation Council of Exobiology's intrest in the Borg remained active up to the year 2353 when they allowed the Hansens to study them. Despite the USS-prefix registry seen on the Raven in "Dark Frontier", I go with the NAR-prefix as seen in the episode "Raven", denoting that the craft was a civilian vessel. The Hansens did not wear uniforms and seemed to be working independantly of Starfleet itself. They obviously weren't flying blind either since they knew what to look for, where to go and Magnus even had built a model Borg cube before ever facing them.
So the real question is why did Starfleet Security disregard the Borg, rendering them little more than a piece of historial trivia (and consequently High Ranking officers like Picard in the dark about their existence), while a small somewhat inconsequential branch of science not only kept the topic alive but allowed civilians not only access to the information but also deemed them capable to carry out such a reckless mission?
Well starfleet command was never that bright most of the time.