Correlation of bremsstrahlung and energy distribution of escaping electrons to study the dynamics of magnetically confined plasma