For determining the highest stat, Beast Boost does not take into account stat stages, held items, or reductions due to status conditions; however, it does consider the effects of Power Split, Guard Split, Power Trick, Wonder Room, and Speed Swap. In the case of a tie between multiple stats, it increases one stat, prioritized in this order: Attack, Defense, Special Attack, Special Defense, and Speed.
So say your Ultra Beast's Attack and Special Attack are the exact same. It knocks out a Pokemon, and its Attack is raised, not its Special Attack.
Hope I helped!