A Model-Based Approach for the Long Term Planning of Distributed Energy Systems in the Energy Transition