Aggregate count over variable number of json keys
The only one thing which I not found is the function/operator for concatenation of JSON objects, so lets create it:

create function json_concat(in json, in json) returns json as $$
  select
    (
      left($1::text, length($1::text)-1) || ', ' ||
      right($2::text, length($2::text)-1)
    )::json; 
$$ immutable language sql;


After this the final query would be:

with t as (
  select band, tag, count(*) as ct 
  from people
  group by band, tag
  order by band, tag)

select json_agg(x)
from (
  select json_concat(json_build_object('band', band), json_object_agg(tag, ct)) as x
  from t 
  group by band) tt;


and result is

[{"band" : "metallica",  "bass" : 1, "drums" : 1, "guitar" : 2, "vocals" : 1 }, {"band" : "beatles",  "bass" : 1, "drums" : 1, "guitar" : 2 }]