The energy system decarbonization leads to a decentralization of generation and flexibility. Among the new concepts to integrate the distributed flexibility are local energy markets. While a broad range of research investigates local energy markets on a distribution grid level in detail, research on their system impact has been limited. Therefore, we develop a framework to investigate different configurations of local markets and operation of distributed energy resources and their interaction with the wholesale markets. This framework is applied to a pan-European case study with detailed bottom-up modeling of local energy markets in France and Germany. Additionally, transmission grid simulations are carried out to investigate the impact of local trading on grid congestions. Our results show that a direct coordination of distributed flexibility within the wholesale market is more efficient than a preference of local trading. Nonetheless, local energy markets can be used as an incentive for expansion of distributed flexibility as well as a way to break down the complexity of coordinating millions of distributed assets in a single market. Additionally, our results show that local trading relieves the transmission grid.