The classic way to backpack around Europe is to purchase a rail pass. This is still a budget-friendly option for most trips. However, keep in mind the following:
The most comprehensive rail pass come from Rail Europe, or the Eurail.
You have numerous options when choosing a pass, everything from purchasing for a single country to a global pass for unlimited travel. Your best bet is to have your itinerary created ahead of time.