This is quite simple actually, all you need is one foreach()
:
$i=-1; //this will increment on first loop so we set it to -1
$key_to_find = $array[0][0]; //storing the 'aaa' value
$result = array();
foreach($array as $key=>$val){
//checking if 'aaa' equals to the first value, if yes increment $i to 0
($val[0]==$key_to_find)?$i++:'';
//save the whole array bunch
$result[$i][] = $val;
}
print_r($result);