You may find Star Pieces randomly in the game. (From using the Dowsing App, digging underground, etc.) You may trade them in for Shard Pieces in the Fuego Ironworks building.
First, you need Star Pieces with you. You will need to Complete the Fuego Ironworks first or else you need to battle all of the trainers before you get to the guy you'll trade Star Pieces for Shards. Go to the guy near the furnace. Talk to him and he'll ask you if you want to trade Star Pieces. Say yes. He'll give you a Red, Blue, Green, and Yellow Shard! You get each for every Star Piece you give him. This is helpful if you want your Pokemon to learn moves from the Move Tutor.