Earlier quoted context omitted.
How is it an illegal operation?
DOGE does not have the authority to shut down independent agencies of the US Government such as USAID.
The exact shape or form of USAID is also up to the president. It was created through an executive order, and can of course also be transformed through one.