New York Times wrote [1] a pretty extensive expose on how the government takeover has happened. Basically Musk started infiltrating the government with his agents a couple of years ago so by the time inauguration happened he had access to all the passwords. I am not sure which laws were broken but if they were I hope the administration that comes in 2029 will not overlook these people's contribution.
[1] https://archive.ph/oJRrI