Understanding Hideyoshi's actions in this period (roughly equivalent to 1591-95) really means grasping how precarious his position – specifically, his dynastic position – must have appeared to him during those years.
He was already in his late 50s, and increasingly ill; it was obvious to him that he was unlikely to live much longer. And the succession was very problematic. In military and political terms, Hideyoshi was, of course, by this time supreme, but while he had largely succeeded in unifying Japan and ending more than a century of civil war, plenty of former enemies were still around, and he himself was in the potentially highly insecure position of being the first ruler of what he clearly hoped would be a long future line of shoguns. While he could depend on the support and deference of plenty of loyalists while he was alive, he could certainly not be sure that all those men would necessarily support his nominated heir after he was dead, and by far the best way of ensuring a smooth transfer of power was for him to live long enough for that heir to come to manhood and be closely associated with the regime.
This seemed very unlikely to happen. Hideyoshi had had one son by a concubine, Chacha (a niece of Oda Nobunaga more usually known to history as Yodo-dono, the name of a castle on the Yodo river that Hideyoshi gifted to her when she first became pregnant). But that child, Tsurumatsu, died in 1591 aged around two, and, despite having plenty of other concubines, the shogun had no other children for some time. It was lack of a male child that encouraged Hideyoshi to think in terms of nominating his oldest nephew, Hidetsugu, as his heir after the deaths of Tsurumatsu and of Hideyoshi's step-brother, Hidenaga, in that year.
Hidetsugu was the son of Hideyoshi's sister. He was aged 23 in 1593, old enough for him to have military roles and to be an active figure in the government. Nonetheless, Hideyoshi clearly did not think that the young man was the ideal heir. His letters reveal that he weighed up the talents of two younger nephews in this period, and also wrote that, if one of his adopted daughters had only been male, he would have named her as his successor.
Hidetsugu's position was further undermined when Chacha had a second son, Hideyori, in 1593, and two years later Hideyoshi abruptly ordered his nephew into exile at Mount Koya. Very shortly thereafter, Hidetsugu received instruction to commit suicide, and thus clear the path for Hideyori's succession.
With regard to the "brutality of the purge", which as you note included other members of Hidetsugu's family (three of them children under the age of five) and retinue, and which also involved Hidetsugu's severed head being placed on display, Berry suggests that, while it certainly underscored Hideoyshi's power, it was at root the product of the suspicion that Hideoyshi seems to have felt regarding his nephew. When the shogun decided to name his nephew as regent of his (planned-for, but never realised) conquests in China, the oath that Hidetsugu was required to sign made prominent mention of his subordination to his uncle. He was not allowed to issue documents under his own seal. Two key diary sources for the period report Hideyoshi's determination to ensure that Hideyori, not Hidetsugu, would be the most important secondary source of power in Japan while the shogun remained alive.
Hideyoshi, moreover, seems to have believed, or at least convinced himself, that Hidetsugu was plotting some sort of rebellion against him. The nephew had increased the size of his own guard, and apparently held discussions with some daimyo in which he suggested, or demanded, that the lords swear additional oaths of loyalty to him personally. Both of these circumstances could plausibly be interpreted as precursors to an uprising.
The final point of interest relates to the accusations of "atrocities" levelled against Hidetsugu. According to Oze Hoan's Taiko-ki (a biography of Hideyoshi first published in 1626), Hidetsugu would practice his musketry by taking aim at the men who farmed his land, and once, to practice archery, he "summoned a passing traveller and slew him." A Jesuit with good contacts at Hideyoshi's court added that Hidetsugu
was so bent, and inclined to shedde men's blood, that he mighte well be thoughte to have sucked that brutish minde together with his mother's milke... one of his chiefest delights was to see poore men slaine and cruelly butchered... for his recreatione, he played the part of an executioner in killinge and murthering.
Those, then, are what the shogun, if not Japan's daimyo, considered "atrocities", at least when it suited him to so so.
Source
Mary Elizabeth Berry, Hideyoshi (Harvard UP 1982)