I am in agreement with Joao in that the 'agregado' was more an instructor.
To illustrate this:
Edward Hawkshaw was at Busaco and Albuera. He was a Major and then became a Lieutenant Colonel in the Loyal Lusitanian Legion [7th Cašadores]in 1810. He ended his service in the Portuguese Army as Lieutenant Colonel agregado in the 2nd Line Regiment about December 1813.