"..My question is, is something like that actually legal?..."
No. it isn't legal.
"...Can I do that?.."
No, you cannot do that.
"...however I am in a country that is a part of the European Union if that matters..."
The member countries of the European Union have differing systems regarding residency, some like Germany are happy for any European citizen to live there for any period of time (presuming they are law abiding and support themselves). Others will require you to seek a residency permit if you plan to remain more than three months, that often entails proving that you can support yourself.
If you attempt to set up camp in a remote area the locals (and there are always locals) won't be happy and will alert the police or rangers. If you look like a homeless person, are in possession of axes and knives and are constructing a shelter on state or private land you will be arrested.
UK prisons aren't much fun but the Prisons further east and north are not places you want to stay.
The legal systems in many of these countries will require you to remain in prison until they can put you in front of a judge, if you are lucky that might be only a few weeks.
Do you speak any other European languages?
As an alternative to your somewhat fanciful notion of carving out a little bit of wilderness for yourself I would suggest seeking out some of the more remote 'off the grid' communities that can be found in Europe, most would be happy to have someone with building skills to lend a hand and quite a few are spread over larger areas so finding and building a quiet space for yourself wouldn't be impossible.
Good luck.
Last edited: