Bayern Munich Chief Scout Pirmin Schwegler has left the Bundesliga champions to join TSG Hoffenheim in a key role within their sports department.