Is XCOM2 a storyline sequel to XCOM Enemy Unknown / Enemy Within?
Solution 1:
The story of XCOM2 is a divergent future from the start of XCOM: Enemy Unknown -- that is to say, the events of players beating the first game are not canon. In the XCOM 2 Universe, the Earth's governments had abandoned XCOM and surrendered to the aliens by July, just 5 months into the invasion.
I won't spoil the details, but you do get an implication quite early on into the game that playing (and winning) XCOM EU/EW were combat simulations.
So, depending on how you want to interpret that, either the events of the first game did not happen, or, the events of the first game happened, but "it was all a dream", and the hard, cold, reality is that the Aliens won.
Solution 2:
My impression is that it is indeed a direct sequel to XCOM EU/EW only that the canon ending (from an XCOM 2 perspective) in XCOM EU/EW is you NOT winning the game!
Rather, the canon ending is you losing to the aliens, something which most players experienced at one point or another.
As quoted in PC Gamer, what creative director Jake Solomon said on the matter is this:
We realised that most players lost their initial playthrough of Enemy Unknown, and we realised there was an interesting and unique opportunity to have XCOM 2 begin with XCOM losing the invasion.
Solution 3:
There is a prequel novel to XCOM 2 called XCOM 2: Resurrection which "bridges the gap between XCOM:EU and XCOM 2".
It's the official prequel novel, so it's canon. Unfortunately I haven't found anyone who's actually read it, so I can't tell you what happens :)
Solution 4:
The novel basically follows a group of resistance soldiers who run into the remnants of XCOM. XCOM is running their HQ out of an old submarine at sea (a pretty cool idea - similar to the Avenger, but human tech). They actually get the Avenger up and running by the end of the novel and XCOM 2 along with it. A few characters from both games pop up (Dr. Shen, etc...). It's not bad if you're a fan of the game's storyline.